Package org.apache.aries.util.filesystem
Interface IDirectory
-
- All Known Subinterfaces:
ICloseableDirectory
- All Known Implementing Classes:
CloseableDirectory
,DirectoryImpl
,InputStreamClosableDirectory
,NestedCloseableDirectory
,NestedZipDirectory
,ZipCloseableDirectory
,ZipDirectory
public interface IDirectory extends java.lang.Iterable<IFile>, IFile
A virtual directory in a file system. Widely used to present a common view of regular file systems, jar and zip files.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IFile
getFile(java.lang.String name)
Gets the requested file under this directory.boolean
isRoot()
java.util.List<IFile>
listAllFiles()
java.util.List<IFile>
listFiles()
ICloseableDirectory
toCloseable()
Open a more effective implementation with user regulated resource management.-
Methods inherited from interface org.apache.aries.util.filesystem.IFile
convert, convertNested, getLastModified, getName, getParent, getRoot, getSize, isDirectory, isFile, open, toURL
-
-
-
-
Method Detail
-
listFiles
java.util.List<IFile> listFiles()
- Returns:
- the list of files in this directory. Files must be in this directory and not in sub-directories.
-
listAllFiles
java.util.List<IFile> listAllFiles()
- Returns:
- the list of files in all directories (including sub-directories). This is the complete list.
-
getFile
IFile getFile(java.lang.String name)
Gets the requested file under this directory. The file may be located any number of levels within this directory. The name is relative to this directory. If the file cannot be found it will return null.- Parameters:
name
- the name of the file.- Returns:
- the IFile, or null if no such file exists.
-
isRoot
boolean isRoot()
- Returns:
- true if this IDirectory is the root of the virtual file system.
-
toCloseable
ICloseableDirectory toCloseable()
Open a more effective implementation with user regulated resource management. The implementation will be more efficient for batch operations. Make sure to call close when finished with the returned IDirectory. IFiles and IDirectories other than the returned closeable directory will stay valid after calling the close method but will no longer perform as efficiently. InputStreams that are open at the time of calling close may be invalidated.- Returns:
ICloseableDirectory
or null if a batch aware version of thisIDirectory
is not supported
-
-