Package org.apache.aries.util.filesystem
Interface IFile
-
- All Known Subinterfaces:
ICloseableDirectory,IDirectory
- All Known Implementing Classes:
CloseableDirectory,DirectoryImpl,FileImpl,InputStreamClosableDirectory,NestedCloseableDirectory,NestedZipDirectory,NestedZipFile,ZipCloseableDirectory,ZipDirectory,ZipFileImpl
public interface IFileA virtual file on the virtual file system. This may represent a file or a directory.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IDirectoryconvert()IDirectoryconvertNested()longgetLastModified()java.lang.StringgetName()IDirectorygetParent()IDirectorygetRoot()longgetSize()booleanisDirectory()booleanisFile()java.io.InputStreamopen()The input stream returned by this method should always be closed after use.java.net.URLtoURL()
-
-
-
Method Detail
-
getName
java.lang.String getName()
- Returns:
- the name of the file relative to the root of the virtual FS. This will return a '/' separated path indepedent of underlying filesystem
-
isDirectory
boolean isDirectory()
- Returns:
- true iff this IFile is also an IDirectory
-
isFile
boolean isFile()
- Returns:
- true iff this IFile is not an IDirectory
-
getLastModified
long getLastModified()
- Returns:
- the last modified date of the file.
-
getSize
long getSize()
- Returns:
- the size of the file.
-
convert
IDirectory convert()
- Returns:
- if this is a directory return this as an IDirectory, otherwise return null.
-
convertNested
IDirectory convertNested()
- Returns:
- if this is a directory or an archive, returns the opened IDirectory
-
getParent
IDirectory getParent()
- Returns:
- returns the parent directory of this IFile, or null if this is the root.
-
open
java.io.InputStream open() throws java.io.IOException, java.lang.UnsupportedOperationExceptionThe input stream returned by this method should always be closed after use.- Returns:
- An InputStream to read the file from.
- Throws:
java.io.IOExceptionjava.lang.UnsupportedOperationException- If the IFile is also an IDirectory.
-
getRoot
IDirectory getRoot()
- Returns:
- the root of this file system.
-
toURL
java.net.URL toURL() throws java.net.MalformedURLException- Returns:
- a URL that can be used to get at this file at a later date.
- Throws:
java.net.MalformedURLException
-
-