This commit is contained in:
Lucio Lelii 2018-06-22 15:42:29 +00:00
parent 5ec8908f0a
commit 4453aba24f
2 changed files with 13 additions and 2 deletions

View File

@ -106,7 +106,7 @@ public class DefaultItemManager implements ItemManagerClient {
Call<WebTarget, URL> call = new Call<WebTarget, URL>() {
@Override
public URL call(WebTarget manager) throws Exception {
WebTarget myManager = manager.path(id).path("publicklink");
WebTarget myManager = manager.path(id).path("publiclink");
Invocation.Builder builder = myManager.request(MediaType.APPLICATION_JSON);
URL response = builder.get(URL.class);
return response;

View File

@ -32,16 +32,27 @@ public class Items {
public void uploadFile() {
StorageHubClient shc = new StorageHubClient();
String afi = null;
try (InputStream is = new FileInputStream(new File("/home/lucio/Downloads/rockandroll.jpeg"))){
String afi = shc.getWSRoot().uploadFile(is, "tes-image.jpeg", "descr").get().getId();
afi = shc.getWSRoot().uploadFile(is, "tes-image.jpeg", "descr").get().getId();
System.out.println(afi);
} catch (Exception e) {
e.printStackTrace();
}
}
@Test
public void getPublicLink() {
StorageHubClient shc = new StorageHubClient();
System.out.println(shc.open("c2573eec-3942-47ec-94a7-04869e97bb69").asFile().getPublicLink());
}
@Test
public void downloadFile() {
StorageHubClient shc = new StorageHubClient();