Package com.badlogic.gdx
Interface Files
-
public interface FilesProvides 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 classFiles.FileTypeIndicates how to resolve a path to a file.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FileHandleabsolute(java.lang.String path)Convenience method that returns aFiles.FileType.Absolutefile handle.FileHandleclasspath(java.lang.String path)Convenience method that returns aFiles.FileType.Classpathfile handle.FileHandleexternal(java.lang.String path)Convenience method that returns aFiles.FileType.Externalfile handle.java.lang.StringgetExternalStoragePath()Returns the external storage path directory.FileHandlegetFileHandle(java.lang.String path, Files.FileType type)Returns a handle representing a file or directory.java.lang.StringgetLocalStoragePath()Returns the local storage path directory.FileHandleinternal(java.lang.String path)Convenience method that returns aFiles.FileType.Internalfile handle.booleanisExternalStorageAvailable()Returns true if the external storage is ready for file IO.booleanisLocalStorageAvailable()Returns true if the local storage is ready for file IO.FileHandlelocal(java.lang.String path)Convenience method that returns aFiles.FileType.Localfile 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.Classpathfile handle.
-
internal
FileHandle internal(java.lang.String path)
Convenience method that returns aFiles.FileType.Internalfile handle.
-
external
FileHandle external(java.lang.String path)
Convenience method that returns aFiles.FileType.Externalfile handle.
-
absolute
FileHandle absolute(java.lang.String path)
Convenience method that returns aFiles.FileType.Absolutefile handle.
-
local
FileHandle local(java.lang.String path)
Convenience method that returns aFiles.FileType.Localfile 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.
-
-