Class AndroidFi

java.lang.Object
arc.files.Fi
arc.backend.android.AndroidFi

public class AndroidFi extends Fi
  • Method Details

    • child

      public Fi child(String name)
      Description copied from class: Fi
      Returns a handle to the child with the specified name.
      Overrides:
      child in class Fi
    • sibling

      public Fi sibling(String name)
      Description copied from class: Fi
      Returns a handle to the sibling with the specified name.
      Overrides:
      sibling in class Fi
    • parent

      public Fi parent()
      Overrides:
      parent in class Fi
    • read

      public InputStream read()
      Description copied from class: Fi
      Returns a stream for reading this file as bytes.
      Overrides:
      read in class Fi
    • map

      public ByteBuffer map(FileChannel.MapMode mode)
      Description copied from class: Fi
      Attempts to memory map this file. Android files must not be compressed.
      Overrides:
      map in class Fi
    • list

      public Fi[] list()
      Description copied from class: Fi
      Returns the paths to the children of this directory. Returns an empty list if this file handle represents a file and not a directory. On the desktop, an Files.internal(java.lang.String) handle to a directory on the classpath will return a zero length array.
      Overrides:
      list in class Fi
    • list

      public Fi[] list(FileFilter filter)
      Description copied from class: Fi
      Returns the paths to the children of this directory that satisfy the specified filter. Returns an empty list if this file handle represents a file and not a directory. On the desktop, an Files.internal(java.lang.String) handle to a directory on the classpath will return a zero length array.
      Overrides:
      list in class Fi
      Parameters:
      filter - the FileFilter to filter files
    • list

      public Fi[] list(FilenameFilter filter)
      Description copied from class: Fi
      Returns the paths to the children of this directory that satisfy the specified filter. Returns an empty list if this file handle represents a file and not a directory. On the desktop, an Files.internal(java.lang.String) handle to a directory on the classpath will return a zero length array.
      Overrides:
      list in class Fi
      Parameters:
      filter - the FilenameFilter to filter files
    • list

      public Fi[] list(String suffix)
      Description copied from class: Fi
      Returns the paths to the children of this directory with the specified suffix. Returns an empty list if this file handle represents a file and not a directory. On the desktop, an Files.internal(java.lang.String) handle to a directory on the classpath will return a zero length array.
      Overrides:
      list in class Fi
    • isDirectory

      public boolean isDirectory()
      Description copied from class: Fi
      Returns true if this file is a directory. Always returns false for classpath files. On Android, an Files.internal(java.lang.String) handle to an empty directory will return false. On the desktop, an Files.internal(java.lang.String) handle to a directory on the classpath will return false.
      Overrides:
      isDirectory in class Fi
    • exists

      public boolean exists()
      Description copied from class: Fi
      Returns true if the file exists. On Android, a Files.classpath(java.lang.String) or Files.internal(java.lang.String) handle to a directory will always return false. Note that this can be very slow for internal files on Android!
      Overrides:
      exists in class Fi
    • length

      public long length()
      Description copied from class: Fi
      Returns the length in bytes of this file, or 0 if this file is a directory, does not exist, or the size cannot otherwise be determined.
      Overrides:
      length in class Fi
    • file

      public File file()
      Description copied from class: Fi
      Returns a java.io.File that represents this file handle. Note the returned file will only be usable for Files.absolute(java.lang.String) and Files.external(java.lang.String) file handles.
      Overrides:
      file in class Fi
    • getAssetFileDescriptor

      public android.content.res.AssetFileDescriptor getAssetFileDescriptor() throws IOException
      Returns:
      an AssetFileDescriptor for this file or null if the file is not of type Internal
      Throws:
      IOException - - thrown by AssetManager.openFd()