java client for godfs!
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);