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.
  • Method Details

    • get

      Fi get(String path, Files.FileType type)
      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

      default Fi classpath(String path)
      Convenience method that returns a classpath(java.lang.String) file handle.
    • internal

      default Fi internal(String path)
      Convenience method that returns a internal(java.lang.String) file handle.
    • external

      default Fi external(String path)
      Convenience method that returns a external(java.lang.String) file handle.
    • absolute

      default Fi absolute(String path)
      Convenience method that returns a absolute(java.lang.String) file handle.
    • local

      default Fi local(String path)
      Convenience method that returns a local(java.lang.String) file handle.
    • cache

      default Fi cache(String path)
      Convenience method that returns a cache file handle.
    • getCachePath

      default String 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.