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

Method Detail

createFolder

DataFolder createFolder(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

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

List<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.

getDataFolder

DataFolder getDataFolder(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(File file)
                throws FileNotFoundException,
                       InternalErrorException,
                       FileAlreadyExistException
Import a file, present in the file system, in this folder.

Parameters:
file - the file to import.
Throws:
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(File folder)
                  throws FileNotFoundException,
                         InternalErrorException
Import a folder, present in the file system, in this folder.

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

exportFolder

void exportFolder(File destFolder)
                  throws InternalErrorException,
                         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.
IOException - if an error occurs during export operation.


Copyright © 2013. All Rights Reserved.