Package arc.backend.android
Class AndroidFi
java.lang.Object
arc.files.Fi
arc.backend.android.AndroidFi
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns a handle to the child with the specified name.boolean
exists()
Returns true if the file exists.file()
Returns a java.io.File that represents this file handle.android.content.res.AssetFileDescriptor
boolean
Returns true if this file is a directory.long
length()
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.Fi[]
list()
Returns the paths to the children of this directory.Fi[]
list
(FileFilter filter) Returns the paths to the children of this directory that satisfy the specified filter.Fi[]
list
(FilenameFilter filter) Returns the paths to the children of this directory that satisfy the specified filter.Fi[]
Returns the paths to the children of this directory with the specified suffix.map
(FileChannel.MapMode mode) Attempts to memory map this file.parent()
read()
Returns a stream for reading this file as bytes.Returns a handle to the sibling with the specified name.Methods inherited from class arc.files.Fi
absolutePath, copyFilesTo, copyTo, delete, deleteDirectory, emptyDirectory, emptyDirectory, equals, extension, extEquals, findAll, findAll, get, hashCode, lastModified, map, mkdirs, moveTo, name, nameWithoutExtension, path, pathWithoutExtension, read, readBytes, readBytes, readByteStream, reader, reader, reader, reader, reads, readsDeflate, readString, readString, seq, tempDirectory, tempFile, toString, type, walk, write, write, write, write, writeBytes, writeBytes, writeBytes, writePng, writer, writer, writes, writes, writesDeflate, writeString, writeString, writeString
-
Method Details
-
child
Description copied from class:Fi
Returns a handle to the child with the specified name. -
sibling
Description copied from class:Fi
Returns a handle to the sibling with the specified name. -
parent
-
read
Description copied from class:Fi
Returns a stream for reading this file as bytes. -
map
Description copied from class:Fi
Attempts to memory map this file. Android files must not be compressed. -
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, anFiles.internal(java.lang.String)
handle to a directory on the classpath will return a zero length array. -
list
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, anFiles.internal(java.lang.String)
handle to a directory on the classpath will return a zero length array.- Overrides:
list
in classFi
- Parameters:
filter
- theFileFilter
to filter files
-
list
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, anFiles.internal(java.lang.String)
handle to a directory on the classpath will return a zero length array.- Overrides:
list
in classFi
- Parameters:
filter
- theFilenameFilter
to filter files
-
list
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, anFiles.internal(java.lang.String)
handle to a directory on the classpath will return a zero length array. -
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, anFiles.internal(java.lang.String)
handle to an empty directory will return false. On the desktop, anFiles.internal(java.lang.String)
handle to a directory on the classpath will return false.- Overrides:
isDirectory
in classFi
-
exists
public boolean exists()Description copied from class:Fi
Returns true if the file exists. On Android, aFiles.classpath(java.lang.String)
orFiles.internal(java.lang.String)
handle to a directory will always return false. Note that this can be very slow for internal files on Android! -
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. -
file
Description copied from class:Fi
Returns a java.io.File that represents this file handle. Note the returned file will only be usable forFiles.absolute(java.lang.String)
andFiles.external(java.lang.String)
file handles. -
getAssetFileDescriptor
- Returns:
- an AssetFileDescriptor for this file or null if the file is not of type Internal
- Throws:
IOException
- - thrown by AssetManager.openFd()
-