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 boolean
exists(java.lang.String name)
Check whether a file exists.java.io.InputStream
getInputStream(java.lang.String name)
Retrieve the named resource as InputStreamjava.io.File
getRoot()
Returns the root folderjava.util.Iterator<AbstractFile>
iterate(java.lang.String name, int depth)
Iterate over files under another file, i.e.java.util.List<AbstractFile>
list(java.lang.String name, int depth)
list files under another file, i.e.java.lang.String
toString()
-
-
-
Method Detail
-
getRoot
public java.io.File getRoot()
Description copied from interface:IAbstractFileSystem
Returns the root folder- Specified by:
getRoot
in interfaceIAbstractFileSystem
- Returns:
- Root folder
-
exists
public boolean exists(java.lang.String name) throws java.io.IOException
Description copied from interface:IAbstractFileSystem
Check whether a file exists.- Specified by:
exists
in interfaceIAbstractFileSystem
- Returns:
true
if the named file exists,false
otherwise.- Throws:
java.io.IOException
-
getInputStream
public java.io.InputStream getInputStream(java.lang.String name) throws java.io.IOException
Description copied from interface:IAbstractFileSystem
Retrieve the named resource as InputStream- Specified by:
getInputStream
in 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:IAbstractFileSystem
list files under another file, i.e. a folder. The first result element is the named file as specified by the signature.- Specified by:
list
in 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:IAbstractFileSystem
Iterate 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:
iterate
in interfaceIAbstractFileSystem
- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-