Package com.badlogic.gdx
Interface Files
-
public interface Files
Provides standard access to the filesystem, classpath, Android app storage (internal and external), and Android assets directory.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Files.FileType
Indicates how to resolve a path to a file.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FileHandle
absolute(java.lang.String path)
Convenience method that returns aFiles.FileType.Absolute
file handle.FileHandle
classpath(java.lang.String path)
Convenience method that returns aFiles.FileType.Classpath
file handle.FileHandle
external(java.lang.String path)
Convenience method that returns aFiles.FileType.External
file handle.java.lang.String
getExternalStoragePath()
Returns the external storage path directory.FileHandle
getFileHandle(java.lang.String path, Files.FileType type)
Returns a handle representing a file or directory.java.lang.String
getLocalStoragePath()
Returns the local storage path directory.FileHandle
internal(java.lang.String path)
Convenience method that returns aFiles.FileType.Internal
file handle.boolean
isExternalStorageAvailable()
Returns true if the external storage is ready for file IO.boolean
isLocalStorageAvailable()
Returns true if the local storage is ready for file IO.FileHandle
local(java.lang.String path)
Convenience method that returns aFiles.FileType.Local
file handle.
-
-
-
Method Detail
-
getFileHandle
FileHandle getFileHandle(java.lang.String path, Files.FileType type)
Returns a handle representing a file or directory.- Parameters:
type
- Determines how the path is resolved.- Throws:
GdxRuntimeException
- if the type is classpath or internal and the file does not exist.- See Also:
Files.FileType
-
classpath
FileHandle classpath(java.lang.String path)
Convenience method that returns aFiles.FileType.Classpath
file handle.
-
internal
FileHandle internal(java.lang.String path)
Convenience method that returns aFiles.FileType.Internal
file handle.
-
external
FileHandle external(java.lang.String path)
Convenience method that returns aFiles.FileType.External
file handle.
-
absolute
FileHandle absolute(java.lang.String path)
Convenience method that returns aFiles.FileType.Absolute
file handle.
-
local
FileHandle local(java.lang.String path)
Convenience method that returns aFiles.FileType.Local
file handle.
-
getExternalStoragePath
java.lang.String getExternalStoragePath()
Returns the external storage path directory. This is the app external storage on Android and the home directory of the current user on the desktop.
-
isExternalStorageAvailable
boolean isExternalStorageAvailable()
Returns true if the external storage is ready for file IO.
-
getLocalStoragePath
java.lang.String getLocalStoragePath()
Returns the local storage path directory. This is the private files directory on Android and the directory of the jar on the desktop.
-
isLocalStorageAvailable
boolean isLocalStorageAvailable()
Returns true if the local storage is ready for file IO.
-
-