Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions antd-java/examples/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
plugins {
java
application
}

repositories {
mavenCentral()
}

dependencies {
implementation(project(":"))
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}

// Pick which example to run with:
// gradle :examples:run -PmainClass=com.autonomi.examples.Example02PublicData
application {
mainClass.set(
(project.findProperty("mainClass") as String?)
?: "com.autonomi.examples.Example02PublicData"
)
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package com.autonomi.examples;

import com.autonomi.antd.AntdClient;
import com.autonomi.antd.models.HealthStatus;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package com.autonomi.examples;

import com.autonomi.antd.AntdClient;
import com.autonomi.antd.models.PutResult;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package com.autonomi.examples;

import com.autonomi.antd.AntdClient;
import com.autonomi.antd.models.FileUploadResult;

Expand All @@ -20,8 +22,8 @@ public static void main(String[] args) {
System.out.println("Downloaded successfully");

// Estimate cost before uploading
String cost = client.fileCost("/path/to/file.txt", true);
System.out.println("Estimated cost: " + cost + " atto");
com.autonomi.antd.models.UploadCostEstimate cost = client.fileCost("/path/to/file.txt", true);
System.out.println("Estimated cost: " + cost.cost() + " atto (" + cost.chunkCount() + " chunks)");
}
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package com.autonomi.examples;

import com.autonomi.antd.AntdClient;
import com.autonomi.antd.errors.*;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package com.autonomi.examples;

import com.autonomi.antd.AntdClient;
import com.autonomi.antd.models.PutResult;

Expand All @@ -18,8 +20,8 @@ public static void main(String[] args) {
System.out.println("Retrieved: " + new String(retrieved));

// Estimate cost
String cost = client.dataCost(secret);
System.out.println("Estimated cost: " + cost + " atto");
com.autonomi.antd.models.UploadCostEstimate cost = client.dataCost(secret);
System.out.println("Estimated cost: " + cost.cost() + " atto (" + cost.chunkCount() + " chunks)");
}
}
}
Empty file modified antd-java/gradlew
100644 → 100755
Empty file.
2 changes: 2 additions & 0 deletions antd-java/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
rootProject.name = "antd-java"

include("examples")