git-svn-id: https://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/Common/storagehub-client@169406 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
5ec8908f0a
commit
4453aba24f
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue