Interface IFile

All Known Subinterfaces:
ICloseableDirectory, IDirectory
All Known Implementing Classes:
CloseableDirectory, DirectoryImpl, FileImpl, InputStreamClosableDirectory, NestedCloseableDirectory, NestedZipDirectory, NestedZipFile, ZipCloseableDirectory, ZipDirectory, ZipFileImpl

public interface IFile
A virtual file on the virtual file system. This may represent a file or a directory.
  • Method Details

    • getName

      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

      The input stream returned by this method should always be closed after use.
      Returns:
      An InputStream to read the file from.
      Throws:
      IOException
      UnsupportedOperationException - If the IFile is also an IDirectory.
    • getRoot

      IDirectory getRoot()
      Returns:
      the root of this file system.
    • toURL

      URL toURL() throws MalformedURLException
      Returns:
      a URL that can be used to get at this file at a later date.
      Throws:
      MalformedURLException