org.gcube.portlets.user.homelibrary.home.data
Interface DataFolder

All Superinterfaces:
DataAreaItem

public interface DataFolder
extends DataAreaItem

A home data folder.

Author:
Federico De Faveri defaveri@isti.cnr.it

Method Summary
 DataFolder createFolder(java.lang.String folderName)
          Create a new folder with the given name.
 void exportFolder(java.io.File destFolder)
          Export this folder and his content in a destination folder in the file system.
 DataFolder getHomeFolder(java.lang.String relPath)
          Return a folder with a path relative to this folder.
 void importFile(java.io.File file)
          Import a file, present in the file system, in this folder.
 void importFolder(java.io.File folder)
          Import a folder, present in the file system, in this folder.
 java.util.List<DataAreaItem> listFiles()
          List all the items into the folder.
 java.util.List<java.lang.String> listFolderNames()
          List all names of the folders inside this folder.
 
Methods inherited from interface org.gcube.portlets.user.homelibrary.home.data.DataAreaItem
getName, getParent, getPath, isFolder
 

Method Detail

createFolder

DataFolder createFolder(java.lang.String folderName)
                        throws InternalErrorException,
                               FolderAlreadyExistException
Create a new folder with the given name.

Parameters:
folderName - the new folder name.
Returns:
the new folder.
Throws:
InternalErrorException - if an internal error occurs.
FolderAlreadyExistException - when a folder with same name already exist.

listFiles

java.util.List<DataAreaItem> listFiles()
                                       throws InternalErrorException
List all the items into the folder.

Returns:
the items in the folder.
Throws:
InternalErrorException - if an internal error occurs.

listFolderNames

java.util.List<java.lang.String> listFolderNames()
                                                 throws InternalErrorException
List all names of the folders inside this folder.

Returns:
the names of folders in the folder.
Throws:
InternalErrorException - if an internal error occurs.

getHomeFolder

DataFolder getHomeFolder(java.lang.String relPath)
                         throws InternalErrorException,
                                FolderNotFoundException
Return a folder with a path relative to this folder.

Parameters:
relPath - the relative path.
Returns:
the folder.
Throws:
InternalErrorException - if an internal error occurs.
FolderNotFoundException - if the folder has not been found.

importFile

void importFile(java.io.File file)
                throws java.io.FileNotFoundException,
                       InternalErrorException,
                       FileAlreadyExistException
Import a file, present in the file system, in this folder.

Parameters:
file - the file to import.
Throws:
java.io.FileNotFoundException - if the file has not found.
InternalErrorException - if an internal error occurs.
FileAlreadyExistException - if a file with specified name already exist.

importFolder

void importFolder(java.io.File folder)
                  throws java.io.FileNotFoundException,
                         InternalErrorException
Import a folder, present in the file system, in this folder.

Parameters:
folder - the folder to import.
Throws:
java.io.FileNotFoundException - if the folder has not found.
InternalErrorException - if an internal error occurs.

exportFolder

void exportFolder(java.io.File destFolder)
                  throws InternalErrorException,
                         java.io.IOException
Export this folder and his content in a destination folder in the file system.

Parameters:
destFolder - the destination folder.
Throws:
InternalErrorException - if an internal error occurs.
java.io.IOException - if an error occurs during export operation.