Class LocalStorage


  • @Service
    public class LocalStorage
    extends java.lang.Object
    This service class provides methods to handle common stuff in the .OpenPatrician directory.
    Author:
    Andi Hotz, (c) Sahits GmbH, 2016 Created on Feb 13, 2016
    • Field Detail

      • SAVEGAME_DIR

        private static final java.lang.String SAVEGAME_DIR
      • PLUGIN_DIR

        public static final java.lang.String PLUGIN_DIR
    • Constructor Detail

      • LocalStorage

        public LocalStorage()
    • Method Detail

      • getAppFolderDirectory

        public java.io.File getAppFolderDirectory()
        Get the File identifying the application folder in the user home directory. If the folder does not exist, it will be created.
        Returns:
        File pointing to the application storage directory.
      • getSavegameDirectory

        public java.io.File getSavegameDirectory()
        Retrieve the savegame directory. If it does not exist it will be created.
        Returns:
        File pointing to the savegame directory.
      • getPluginDirectory

        public java.io.File getPluginDirectory()
        Retrieve the plugin directory. If it does not exist it will be created.
        Returns:
        File pointing to the plugin directory.
      • getPluginDirectoryPath

        public java.lang.String getPluginDirectoryPath()
        Retrieve the plugin directory path. There is no check if the directory exists.
        Returns:
        path to the plugin directory.
      • getPluginTypeDirecotryPath

        public java.lang.String getPluginTypeDirecotryPath​(EPluginType type)
        Extract the path for the plugin based on the plugin type and the file name of the plugin zip archive. If the directory does not exist, create it.
        Parameters:
        type - of the plugin
        Returns:
        directory path of the plugin type.
      • createNonExistingDirectory

        private void createNonExistingDirectory​(java.io.File f)