Class CommonFolders

java.lang.Object
com.equo.application.client.os.CommonFolders
Direct Known Subclasses:
Linux, Mac, Windows

public abstract class CommonFolders extends Object
The CommonFolders class represents common directories and their paths in a file system. It provides methods to retrieve paths for cache, data, state, runtime, and config directories. This class also handles the instantiation of platform-specific implementations based on the operating system.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Dir represents various types of directories.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract Path
    Returns the path of the cache directory based on the rootConfig.
    abstract Path
    Returns the path of the config directory based on the rootConfig.
    abstract Path
    Returns the path of the data directory based on the rootConfig.
    Returns an instance of a class based on the operating system being used.
    abstract Path
    Returns the path of the runtime directory based on the rootConfig.
    abstract Path
    Returns the path of the state directory based on the rootConfig.
    protected String
    Returns the path of the user's home directory.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • CommonFolders

      public CommonFolders()
  • Method Details

    • userHome

      protected String userHome()
      Returns the path of the user's home directory.
      Returns:
      The value of the system property "user.home", which represents the user's home directory.
    • cacheDirHome

      public abstract Path cacheDirHome()
      Returns the path of the cache directory based on the rootConfig.
      Returns:
      The path of the cache directory based on the rootConfig.
    • dataDirHome

      public abstract Path dataDirHome()
      Returns the path of the data directory based on the rootConfig.
      Returns:
      The path of the data directory based on the rootConfig.
    • stateDirHome

      public abstract Path stateDirHome()
      Returns the path of the state directory based on the rootConfig.
      Returns:
      The path of the state directory based on the rootConfig.
    • runtimeDirHome

      public abstract Path runtimeDirHome()
      Returns the path of the runtime directory based on the rootConfig.
      Returns:
      The path of the runtime directory based on the rootConfig.
    • configDir

      public abstract Path configDir()
      Returns the path of the config directory based on the rootConfig.
      Returns:
      The path of the config directory based on the rootConfig.
    • getInstance

      public static CommonFolders getInstance()
      Returns an instance of a class based on the operating system being used.
      Returns:
      The method returns an instance of the `CommonFolders` class, depending on the operating system in use. If it's Windows, it returns an instance of the `Windows` class; if it's Macintosh, it returns an instance of the `Mac` class. Otherwise, it returns an instance of the `Linux` class.