Class FolderContainer
- java.lang.Object
-
- org.gcube.common.storagehub.client.dsl.ItemContainer<org.gcube.common.storagehub.model.items.FolderItem>
-
- org.gcube.common.storagehub.client.dsl.FolderContainer
-
public class FolderContainer extends ItemContainer<org.gcube.common.storagehub.model.items.FolderItem>
-
-
Field Summary
-
Fields inherited from class org.gcube.common.storagehub.client.dsl.ItemContainer
item, itemclient, itemId
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedFolderContainer(ItemManagerClient itemclient, String folderId)protectedFolderContainer(ItemManagerClient itemclient, org.gcube.common.storagehub.model.items.FolderItem item)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description URLContaineraddUrl(URL url, String name, String description)creates a inside the folder represented by this FolderContainerbooleancanWrite()FolderContainerchangeAcls(String user, org.gcube.common.storagehub.model.acls.AccessType accessType)changes of the {FolderItem} represented by this FolderContainer for a userListResolverfindByName(String namePattern)returns the children of this that matches the name patternList<org.gcube.common.storagehub.model.acls.ACL>getAcls()returns the of the {FolderItem} represented by this FolderContainerContainerTypegetType()org.gcube.common.storagehub.model.types.FolderInfoTypeinfo()retrieve the folder info (item count and size)ListResolverTypedlist()returns the children of this By default this method return all FolderContainers (asContainers) or Items (asItems) without accounting data, content data and metadata of the item to add these information seeFolderContainernewExternalFolder(String name, String description, boolean hidden, String storageName, org.gcube.common.storagehub.model.plugins.PluginParameters storageParameters)create a new inside the represented by this FolderContainerFolderContainernewFolder(String name, String description)create a new inside the represented by this FolderContainerGenericItemContainernewGcubeItem(org.gcube.common.storagehub.model.items.GCubeItem item)create a new hidden Folder inside the folder represented by this FolderContainerFolderContainernewHiddenFolder(String name, String description)create a new hidden inside the folder represented by this FolderContainerOpenResolveropenByRelativePath(String relativePath)returns the children of this that matches the name patternFolderContainerpublish()makes this Folder public.ListResolversearch(String nameTomatch)returns the items that matches the name pattern searching recursively on all subfoldersListResolversearch(String nameTomatch, boolean excludeTrashed)returns the items that matches the name pattern searching recursively on all subfolders filtering the trashed ItemsFolderContainershare(Set<String> users, org.gcube.common.storagehub.model.acls.AccessType accessType)shares this Folder with a list of users setting the same for everyone in the list.FolderContainerunpublish()unpublish this Folder.FolderContainerunshare(Set<String> users)remove share from this Folder for a list of users, for everyone or only for the caller.FolderContaineruploadArchive(InputStream stream, String extractionFolderName)creates a set of in the workspace extracting the ArchiveFolderContaineruploadArchive(InputStream stream, String extractionFolderName, long size)creates a set of in the workspace extracting the ArchiveFileContaineruploadFile(File file, String description)creates a inside the folder represented by this FolderContainerFileContaineruploadFile(InputStream stream, String filename, String description)creates a inside the folder represented by this FolderContainerFileContaineruploadFile(InputStream stream, String filename, String description, long size)creates a inside the folder represented by this FolderContainerFileContaineruploadFile(URI uri, String name, String description)creates a inside the folder represented by this FolderContainer-
Methods inherited from class org.gcube.common.storagehub.client.dsl.ItemContainer
delete, download, forceDelete, get, getAnchestors, getId, getRootSharedFolder, invalidateItem, move, rename, setDescription, setHidden, setItem, setMetadata, setVisible
-
-
-
-
Constructor Detail
-
FolderContainer
protected FolderContainer(ItemManagerClient itemclient, org.gcube.common.storagehub.model.items.FolderItem item)
-
FolderContainer
protected FolderContainer(ItemManagerClient itemclient, String folderId)
-
-
Method Detail
-
getType
public ContainerType getType()
- Specified by:
getTypein classItemContainer<org.gcube.common.storagehub.model.items.FolderItem>
-
list
public ListResolverTyped list() throws org.gcube.common.storagehub.model.exceptions.StorageHubException
returns the children of this By default this method return all FolderContainers (asContainers) or Items (asItems) without accounting data, content data and metadata of the item to add these information see- Returns:
- Throws:
org.gcube.common.storagehub.model.exceptions.StorageHubException
-
uploadFile
public FileContainer uploadFile(InputStream stream, String filename, String description) throws org.gcube.common.storagehub.model.exceptions.StorageHubException
creates a inside the folder represented by this FolderContainer- Parameters:
stream- the file streamfilename- the name of the item in the workspacedescription- the description of the item in the workspace- Returns:
- of the Item created
- Throws:
org.gcube.common.storagehub.model.exceptions.StorageHubException
-
uploadFile
public FileContainer uploadFile(InputStream stream, String filename, String description, long size) throws org.gcube.common.storagehub.model.exceptions.StorageHubException
creates a inside the folder represented by this FolderContainer- Parameters:
stream- the file streamfilename- the name of the item in the workspacedescription- the description of the item in the workspacesize- the size of the stream in Bytes- Returns:
- of the Item created
- Throws:
org.gcube.common.storagehub.model.exceptions.StorageHubException
-
uploadFile
public FileContainer uploadFile(File file, String description) throws org.gcube.common.storagehub.model.exceptions.StorageHubException
creates a inside the folder represented by this FolderContainer- Parameters:
file- the filedescription- the description of the item in the workspace- Returns:
- of the Item created
- Throws:
org.gcube.common.storagehub.model.exceptions.StorageHubException
-
uploadFile
public FileContainer uploadFile(URI uri, String name, String description) throws org.gcube.common.storagehub.model.exceptions.StorageHubException
creates a inside the folder represented by this FolderContainer- Parameters:
uri- URI of the filename- the name of the item in the workspacedescription- the description of the item in the workspace- Returns:
- of the Item created
- Throws:
org.gcube.common.storagehub.model.exceptions.StorageHubException
-
addUrl
public URLContainer addUrl(URL url, String name, String description) throws org.gcube.common.storagehub.model.exceptions.StorageHubException
creates a inside the folder represented by this FolderContainer- Parameters:
url- the urlname- the name of the item in the workspacedescription- the description of the item in the workspace- Returns:
- of the Item created
- Throws:
org.gcube.common.storagehub.model.exceptions.StorageHubException
-
uploadArchive
public FolderContainer uploadArchive(InputStream stream, String extractionFolderName) throws org.gcube.common.storagehub.model.exceptions.StorageHubException
creates a set of in the workspace extracting the Archive- Parameters:
stream- the file streamextractionFolderName- the root name of the folder where the archive will be extracted (A new folder with this name will be created)- Returns:
- of the extraction Folder
- Throws:
org.gcube.common.storagehub.model.exceptions.StorageHubException
-
uploadArchive
public FolderContainer uploadArchive(InputStream stream, String extractionFolderName, long size) throws org.gcube.common.storagehub.model.exceptions.StorageHubException
creates a set of in the workspace extracting the Archive- Parameters:
stream- the file streamextractionFolderName- the root name of the folder where the archive will be extracted (A new folder with this name will be created)- Returns:
- of the extraction Folder
- Throws:
org.gcube.common.storagehub.model.exceptions.StorageHubException
-
newFolder
public FolderContainer newFolder(String name, String description) throws org.gcube.common.storagehub.model.exceptions.StorageHubException
create a new inside the represented by this FolderContainer- Parameters:
name- the name of the folderdescription- the description of the folder- Returns:
- the representing the new folder
- Throws:
org.gcube.common.storagehub.model.exceptions.StorageHubException
-
newExternalFolder
public FolderContainer newExternalFolder(String name, String description, boolean hidden, String storageName, org.gcube.common.storagehub.model.plugins.PluginParameters storageParameters) throws org.gcube.common.storagehub.model.exceptions.StorageHubException
create a new inside the represented by this FolderContainer- Parameters:
name- the name of the folderdescription- the description of the folder- Returns:
- the representing the new folder
- Throws:
org.gcube.common.storagehub.model.exceptions.StorageHubException
-
newHiddenFolder
public FolderContainer newHiddenFolder(String name, String description) throws org.gcube.common.storagehub.model.exceptions.StorageHubException
create a new hidden inside the folder represented by this FolderContainer- Parameters:
name- the name of the folderdescription- the description of the folder- Returns:
- the representing the new folder
- Throws:
org.gcube.common.storagehub.model.exceptions.StorageHubException
-
newGcubeItem
public GenericItemContainer newGcubeItem(org.gcube.common.storagehub.model.items.GCubeItem item) throws org.gcube.common.storagehub.model.exceptions.StorageHubException
create a new hidden Folder inside the folder represented by this FolderContainer- Parameters:
name- the name of the folderdescription- the description of the folder- Returns:
- the representing the new folder
- Throws:
org.gcube.common.storagehub.model.exceptions.StorageHubException
-
getAcls
public List<org.gcube.common.storagehub.model.acls.ACL> getAcls() throws org.gcube.common.storagehub.model.exceptions.StorageHubException
returns the of the {FolderItem} represented by this FolderContainer- Returns:
- a List of
- Throws:
org.gcube.common.storagehub.model.exceptions.StorageHubException
-
changeAcls
public FolderContainer changeAcls(String user, org.gcube.common.storagehub.model.acls.AccessType accessType) throws org.gcube.common.storagehub.model.exceptions.StorageHubException
changes of the {FolderItem} represented by this FolderContainer for a user- Returns:
- the
- Throws:
org.gcube.common.storagehub.model.exceptions.StorageHubException
-
findByName
public ListResolver findByName(String namePattern) throws org.gcube.common.storagehub.model.exceptions.StorageHubException
returns the children of this that matches the name pattern- Returns:
- Throws:
org.gcube.common.storagehub.model.exceptions.StorageHubException
-
openByRelativePath
public OpenResolver openByRelativePath(String relativePath) throws org.gcube.common.storagehub.model.exceptions.StorageHubException
returns the children of this that matches the name pattern- Returns:
- Throws:
org.gcube.common.storagehub.model.exceptions.StorageHubException
-
search
public ListResolver search(String nameTomatch, boolean excludeTrashed) throws org.gcube.common.storagehub.model.exceptions.StorageHubException
returns the items that matches the name pattern searching recursively on all subfolders filtering the trashed Items- Returns:
- Throws:
org.gcube.common.storagehub.model.exceptions.StorageHubException
-
search
public ListResolver search(String nameTomatch) throws org.gcube.common.storagehub.model.exceptions.StorageHubException
returns the items that matches the name pattern searching recursively on all subfolders- Returns:
- Throws:
org.gcube.common.storagehub.model.exceptions.StorageHubException
-
share
public FolderContainer share(Set<String> users, org.gcube.common.storagehub.model.acls.AccessType accessType) throws org.gcube.common.storagehub.model.exceptions.StorageHubException
shares this Folder with a list of users setting the same for everyone in the list. if the folder is already shared it add the users to the share.- Returns:
- the current updated
- Throws:
org.gcube.common.storagehub.model.exceptions.StorageHubException
-
unshare
public FolderContainer unshare(Set<String> users) throws Exception
remove share from this Folder for a list of users, for everyone or only for the caller. Is applicable only on . if users is empty or null unshare the entire folder for everyone. if users contains only the caller login the folder is removed only for him.- Returns:
- the current updated
- Throws:
Exception
-
unpublish
public FolderContainer unpublish() throws Exception
unpublish this Folder.- Returns:
- the current updated
- Throws:
Exception
-
publish
public FolderContainer publish() throws Exception
makes this Folder public.- Returns:
- the current updated
- Throws:
Exception
-
-