This commit is contained in:
Lucio Lelii 2018-09-28 15:02:20 +00:00
parent 0c51015163
commit c83f71498e
2 changed files with 7 additions and 8 deletions

View File

@ -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())

View File

@ -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");
}