git-svn-id: https://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/Common/storagehub-client@171757 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
0c51015163
commit
c83f71498e
|
@ -592,7 +592,7 @@ public class DefaultItemManager implements ItemManagerClient {
|
|||
formData.add("fileName", newFilename);
|
||||
|
||||
|
||||
GXInboundResponse response = myManager.post(Entity.form(formData));
|
||||
GXInboundResponse response = myManager.put(Entity.form(formData));
|
||||
|
||||
if (response.isErrorResponse()) {
|
||||
if (response.hasException())
|
||||
|
|
|
@ -55,19 +55,18 @@ public class Items {
|
|||
|
||||
|
||||
@Test
|
||||
public void uploadFile() throws Exception {
|
||||
public void uploadAndcopyFile() throws Exception {
|
||||
StorageHubClient shc = new StorageHubClient();
|
||||
|
||||
|
||||
String afi = null;
|
||||
|
||||
FileContainer file = null;
|
||||
try(InputStream is = new FileInputStream(new File("/home/lucio/Downloads/TatyanaSondre.jpg"))){
|
||||
shc.getWSRoot().uploadFile(is, "TatyanaSondre.jpg", "descr");
|
||||
|
||||
System.out.println(afi);
|
||||
file = shc.getWSRoot().uploadFile(is, "TatyanaSondre3.jpg", "descr");
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
file.copy(shc.getWSRoot(), "firstCopy.jpg");
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue