The pydio java sdk provides a Java implementation of features for communicating with a Pydio server Cells and Pydio 8+ versions. Most of the functions are wrapped into the com.pydio.sdk.core.Client class that contains methods to easily manage your files on a Pydio server.
Given an URL, we create a ServerNode object to load the server info
String url = "https://demo.pydio.com";
ServerNode node = new ServerNode();
Error error = node.resolve();
if (error != null) {
// error.code could be
//Code.ssl_error or
//Code.pydio_server_not_supported or
//Code.pydio_server_not_supported or
//Code.con_failed or
//Code.ssl_certificate_not_signed or
System.out.println("failed to resolve server");
return;
}
System.out.println("version: " + server.getVersion());
System.out.println("version name: " + server.getVersionName());
To create a client pass the resolved server to the client factory
Client client = Client.get(node);
Credentials credentials = new DefaultCredentials("login", "password");
client.setCredentials(credentials);
//listing root of "My Files" workspace
try {
client.ls("my-files", "/", (n) -> {
System.out.println(n.label());
});
} catch(SDKexception e) {
e.printStackTrace();
Error error = Error.fromException(e)
// error.code could be
//Code.ssl_error or
//Code.pydio_server_not_supported or
//Code.pydio_server_not_supported or
//Code.con_failed or
//Code.ssl_certificate_not_signed or
}
Find more examples here