Package arc
Interface Files
- All Known Implementing Classes:
AndroidFiles
,IOSFiles
,MockFiles
,SdlFiles
public interface Files
Provides standard access to the filesystem, classpath, Android SD card, and Android assets directory.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Indicates how to resolve a path to a file. -
Method Summary
Modifier and TypeMethodDescriptiondefault Fi
Convenience method that returns aabsolute(java.lang.String)
file handle.default Fi
Convenience method that returns a cache file handle.default Fi
Convenience method that returns aclasspath(java.lang.String)
file handle.default Fi
Convenience method that returns aexternal(java.lang.String)
file handle.get
(String path, Files.FileType type) Returns a handle representing a file or directory.default String
default Fi
Convenience method that returns ainternal(java.lang.String)
file handle.boolean
boolean
default Fi
Convenience method that returns alocal(java.lang.String)
file handle.
-
Method Details
-
get
Returns a handle representing a file or directory.- Parameters:
type
- Determines how the path is resolved.- Throws:
ArcRuntimeException
- if the type is classpath or internal and the file does not exist.- See Also:
-
classpath
Convenience method that returns aclasspath(java.lang.String)
file handle. -
internal
Convenience method that returns ainternal(java.lang.String)
file handle. -
external
Convenience method that returns aexternal(java.lang.String)
file handle. -
absolute
Convenience method that returns aabsolute(java.lang.String)
file handle. -
local
Convenience method that returns alocal(java.lang.String)
file handle. -
cache
Convenience method that returns a cache file handle. -
getCachePath
- Returns:
- absolute path to cache directory.
-
getExternalStoragePath
String getExternalStoragePath()- Returns:
- the external storage path directory. This is the SD card 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. Eg, on Android, the SD card is not available when mounted for use with a PC.
-
getLocalStoragePath
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.
-