ch.systemsx.cisd.openbis.dss.generic.shared.api.v1
Class FileInfoDssBuilder

java.lang.Object
  extended by ch.systemsx.cisd.openbis.dss.generic.shared.api.v1.FileInfoDssBuilder

public class FileInfoDssBuilder
extends java.lang.Object

Helper Class for creating FileInfoDss objects based on file system.

NOTE: This implementation is not using file system abstraction and therefore doesn't support special handling for HDF5 containers or data set containers. In cases when such a support would be required use HierarchicalFileInfoDssBuilder.


Constructor Summary
FileInfoDssBuilder(java.lang.String dataSetRoot, java.lang.String relativeRoot)
          Constructor for FileInfoDssFactory
 
Method Summary
 void appendFileInfosForFile(java.io.File requestedFile, java.util.ArrayList<FileInfoDssDTO> list, boolean isRecursive)
          Append file info for the requested file or file hierarchy.
static java.util.List<FileInfoDssDTO> getFileInfos(java.io.File dataSetContents)
          Return a list of FileInfoDssDTO objects corresponding to all files existing within a certain folder.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileInfoDssBuilder

public FileInfoDssBuilder(java.lang.String dataSetRoot,
                          java.lang.String relativeRoot)
Constructor for FileInfoDssFactory

Parameters:
dataSetRoot - The root of the directory structure; used to determine the path for FileInfoDss objects
Method Detail

getFileInfos

public static java.util.List<FileInfoDssDTO> getFileInfos(java.io.File dataSetContents)
Return a list of FileInfoDssDTO objects corresponding to all files existing within a certain folder. The list is accumulated recursively.


appendFileInfosForFile

public void appendFileInfosForFile(java.io.File requestedFile,
                                   java.util.ArrayList<FileInfoDssDTO> list,
                                   boolean isRecursive)
                            throws java.io.IOException
Append file info for the requested file or file hierarchy. Assumes that the parameters have been verified already.

Parameters:
requestedFile - A file known to be accessible by the user
list - The list the files infos are appended to
isRecursive - If true, directories will be recursively appended to the list
Throws:
java.io.IOException