Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 940 Bytes

README.md

File metadata and controls

39 lines (29 loc) · 940 Bytes

godfs-java-client

java client for godfs!

Build Status

maven dependency:

<dependency>
  <groupId>com.github.hetianyi</groupId>
  <artifactId>godfs-java-client</artifactId>
  <version>1.0.2</version>
</dependency>

Simple usage:

# Init client
ClientConfigurationBean configuration = new ClientConfigurationBean();
configuration.setSecret("OASAD834jA97AAQE761==");

Tracker tracker = new Tracker();
tracker.setHost("127.0.0.1");
tracker.setPort(1022);
tracker.setMaxConnections(5);
configuration.addTracker(tracker);

client = new GoDFSClient(configuration);
client.start();

# do something
final GodfsApiClient apiClient = client.getGodfsApiClient();
File file = new File("/tmp/foo/bar");
String path = apiClient.upload(file, null, new UploadProgressMonitor());
System.out.println(path);