Class FileSystemImpl
- java.lang.Object
-
- com.zfabrik.components.provider.fs.FileSystemImpl
-
- All Implemented Interfaces:
IAbstractFileSystem
public class FileSystemImpl extends java.lang.Object implements IAbstractFileSystem
-
-
Constructor Summary
Constructors Constructor Description FileSystemImpl(java.io.File root)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanexists(java.lang.String name)Check whether a file exists.java.io.InputStreamgetInputStream(java.lang.String name)Retrieve the named resource as InputStreamjava.io.FilegetRoot()Returns the root folderjava.util.Iterator<AbstractFile>iterate(java.lang.String name, int depth)Iterate over files under another file, i.e. a folder.java.util.List<AbstractFile>list(java.lang.String name, int depth)list files under another file, i.e. a folder.java.lang.StringtoString()
-
-
-
Method Detail
-
getRoot
public java.io.File getRoot()
Description copied from interface:IAbstractFileSystemReturns the root folder- Specified by:
getRootin interfaceIAbstractFileSystem- Returns:
- Root folder
-
exists
public boolean exists(java.lang.String name) throws java.io.IOExceptionDescription copied from interface:IAbstractFileSystemCheck whether a file exists.- Specified by:
existsin interfaceIAbstractFileSystem- Returns:
trueif the named file exists,falseotherwise.- Throws:
java.io.IOException
-
getInputStream
public java.io.InputStream getInputStream(java.lang.String name) throws java.io.IOExceptionDescription copied from interface:IAbstractFileSystemRetrieve the named resource as InputStream- Specified by:
getInputStreamin interfaceIAbstractFileSystem- Throws:
java.io.IOException
-
list
public java.util.List<AbstractFile> list(java.lang.String name, int depth) throws java.io.IOException
Description copied from interface:IAbstractFileSystemlist files under another file, i.e. a folder. The first result element is the named file as specified by the signature.- Specified by:
listin interfaceIAbstractFileSystem- Throws:
java.io.IOException
-
iterate
public java.util.Iterator<AbstractFile> iterate(java.lang.String name, int depth) throws java.io.IOException
Description copied from interface:IAbstractFileSystemIterate over files under another file, i.e. a folder. The first result element is the named file as specified by the signature. When working over large sets of files this method should realize the advantage that it does not require to read everything in advance, saving memory and time.- Specified by:
iteratein interfaceIAbstractFileSystem- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-