added method to dsl

This commit is contained in:
Lucio Lelii 2022-11-16 17:50:30 +01:00
parent 18d2fb9287
commit 3d7c334afd
2 changed files with 31 additions and 1 deletions

View File

@ -59,6 +59,21 @@ public class FolderContainer extends ItemContainer<FolderItem>{
return new FileContainer(itemclient, itemclient.uploadFile(stream, this.itemId , filename, description));
}
/**
*
* creates a {@AbstractFileItem} inside the folder represented by this FolderContainer
*
* @param stream the file stream
* @param filename the name of the item in the workspace
* @param description the description of the item in the workspace
* @return {@FileContainer} of the Item created
* @throws {@InvalidItemException}
* @throws {@UserNotAuthorizedException} if user is not authorized to write in this folder
*/
public FileContainer uploadFile(InputStream stream, String filename, String description, long size) throws StorageHubException {
return new FileContainer(itemclient, itemclient.uploadFile(stream, this.itemId , filename, description, size));
}
/**
*
* creates a {@AbstractFileItem} inside the folder represented by this FolderContainer
@ -72,6 +87,7 @@ public class FolderContainer extends ItemContainer<FolderItem>{
public FileContainer uploadFile(File file, String description) throws StorageHubException {
return new FileContainer(itemclient, itemclient.uploadFile(file, this.itemId , file.getName(), description));
}
/**
*
@ -102,6 +118,20 @@ public class FolderContainer extends ItemContainer<FolderItem>{
return new FolderContainer(itemclient, itemclient.uploadArchive(stream, this.itemId , extractionFolderName));
}
/**
*
* creates a set of {@Item} in the workspace extracting the Archive
*
* @param stream the file stream
* @param extractionFolderName the root name of the folder where the archive will be extracted (A new folder with this name will be created)
* @return {@FolderContainer} of the extraction Folder
* @throws {@InvalidItemException}
* @throws {@UserNotAuthorizedException} if user is not authorized to write in this folder
*/
public FolderContainer uploadArchive(InputStream stream, String extractionFolderName, long size) throws StorageHubException {
return new FolderContainer(itemclient, itemclient.uploadArchive(stream, this.itemId , extractionFolderName, size));
}
/**
*
* create a new {@FolderItem} inside the {@FolderItem} represented by this FolderContainer

View File

@ -633,7 +633,7 @@ public class DefaultItemManager extends DefaultManagerClient implements ItemMana
@Override
public String uploadFile(InputStream stream, String parentId, String fileName, String description) throws StorageHubException {
return this.uploadFile(stream, parentId, fileName, description, 0);
return this.uploadFile(stream, parentId, fileName, description, -1);
}
@Override