Class PathsConfig

  • All Implemented Interfaces:

    
    public final class PathsConfig
    
                        

    Settings-group for ServerPackCreators home-directory and every directory and file derived from it: configs, logs, manifests, work/temp, modpacks, server-files with the default templates, plugins, the server-packs directory with its override, and the Tomcat-directories of the webservice. The home-directory itself resolves through the given preferences. Extracted from ApiProperties (refactor Phase 1b); ApiProperties remains the facade through which consumers access these values.

    • Method Detail

      • getHome

         final File getHome()

        Default home-directory for ServerPackCreator: the directory containing the ServerPackCreator JAR.

      • getHomeDirectory

         final File getHomeDirectory()

        ServerPackCreators home directory, in which all important files and folders are stored in.

        Changes made to this variable are stored in an overrides.properties inside the installation directory of the ServerPackCreator application.

        Every operation is based on this home-directory, with the exception being the serverPacksDirectory, which can be configured independently of ServerPackCreators home-directory.

      • setHomeDirectory

         final Unit setHomeDirectory(File value)

        ServerPackCreators home directory, in which all important files and folders are stored in.

        Changes made to this variable are stored in an overrides.properties inside the installation directory of the ServerPackCreator application.

        Every operation is based on this home-directory, with the exception being the serverPacksDirectory, which can be configured independently of ServerPackCreators home-directory.

      • getServerPackCreatorPropertiesFile

         final File getServerPackCreatorPropertiesFile()

        The serverpackcreator.properties-file which both resulted from starting ServerPackCreator and provided the settings, properties and configurations for the currently running instance.

      • getDefaultConfig

         final File getDefaultConfig()

        Default configuration-file for a server pack generation inside ServerPackCreators home-directory.

      • getConfigsDirectory

         final File getConfigsDirectory()

        Directory in which ServerPackCreator configurations from the GUI get saved in by default.

      • getTomcatBaseDirectory

         final File getTomcatBaseDirectory()

        Base-directory for Tomcat, used by the webservice-side of ServerPackCreator.

      • getServerPacksDirectory

         final File getServerPacksDirectory()

        Directory in which generated server packs, or server packs being generated, are stored in, as well as their ZIP-archives, if created.

        By default, this directory will be the server-packs-directory in the home-directory of ServerPackCreator, but it can be configured using the property de.griefed.serverpackcreator.configuration.directories.serverpacks and can even be configured to be completely independent of ServerPackCreators home-directory.

      • setServerPacksDirectory

         final Unit setServerPacksDirectory(File value)

        Directory in which generated server packs, or server packs being generated, are stored in, as well as their ZIP-archives, if created.

        By default, this directory will be the server-packs-directory in the home-directory of ServerPackCreator, but it can be configured using the property de.griefed.serverpackcreator.configuration.directories.serverpacks and can even be configured to be completely independent of ServerPackCreators home-directory.

      • getLogsDirectory

         final File getLogsDirectory()

        Storage location for logs created by ServerPackCreator. This is the logs-directory inside ServerPackCreators home-directory.

      • getTomcatLogsDirectory

         final File getTomcatLogsDirectory()

        Logs-directory for Tomcat, used by the webservice-side of ServerPackCreator.

      • getManifestsDirectory

         final File getManifestsDirectory()

        Directory to which default/fallback manifests are copied to during the startup of ServerPackCreator.

        When the de.griefed.serverpackcreator.api.versionmeta.VersionMeta is initialized, the manifests copied to this directory will provide ServerPackCreator with the information required to check and create your server packs.

        By default, this is the manifests-directory inside ServerPackCreators home-directory.

      • getFabricIntermediariesManifest

         final File getFabricIntermediariesManifest()

        The Fabric intermediaries manifest containing all required information about Fabrics intermediaries. These intermediaries are used by Quilt, Fabric and LegacyFabric.

        By default, the fabric-intermediaries-manifest.json-file resides in the manifests-directory inside ServerPackCreators home-directory.

      • getLegacyFabricGameManifest

         final File getLegacyFabricGameManifest()

        The LegacyFabric game version manifest containing information about which Minecraft version LegacyFabric is available for.

        By default, the legacy-fabric-game-manifest.json-file resides in the manifests-directory inside ServerPackCreators home-directory.

      • getLegacyFabricLoaderManifest

         final File getLegacyFabricLoaderManifest()

        LegacyFabric loader manifest containing information about Fabric loader maven versions.

        By default, the legacy-fabric-loader-manifest.json-file resides in the manifests-directory inside ServerPackCreators home-directory.

      • getLegacyFabricInstallerManifest

         final File getLegacyFabricInstallerManifest()

        LegacyFabric installer manifest containing information about available LegacyFabric installers with which to install a server.

        By default, the legacy-fabric-installer-manifest.xml-file resides in the manifests-directory inside ServerPackCreators home-directory.

      • getFabricInstallerManifest

         final File getFabricInstallerManifest()

        Fabric installer manifest containing information about available Fabric installers with which to install a server.

        By default, the fabric-installer-manifest.xml-file resides in the manifests-directory inside ServerPackCreators home-directory.

      • getQuiltVersionManifest

         final File getQuiltVersionManifest()

        Quilt version manifest containing information about available Quilt loader versions.

        By default, the quilt-manifest.xml-file resides in the manifests-directory inside ServerPackCreators home-directory.

      • getQuiltInstallerManifest

         final File getQuiltInstallerManifest()

        Quilt installer manifest containing information about available Quilt installers with which to install a server.

        By default, the quilt-installer-manifest.xml-file resides in the manifests-directory inside ServerPackCreators home-directory.

      • getForgeVersionManifest

         final File getForgeVersionManifest()

        Forge version manifest containing information about available Forge loader versions.

        By default, the forge-manifest.json-file resides in the manifests-directory inside ServerPackCreators home-directory.

      • getOldNeoForgeVersionManifest

         final File getOldNeoForgeVersionManifest()

        Old NeoForge version manifest containing information about available NeoForge loader versions. This manifest only contains versions for Minecraft 1.20.1.

        By default, the neoforge-manifest.xml-file resides in the manifests-directory inside ServerPackCreators home-directory.

      • getNewNeoForgeVersionManifest

         final File getNewNeoForgeVersionManifest()

        New NeoForge version manifest containing information about available NeoForge loader versions. This manifest contains versions for Minecraft 1.20.2 and up.

        By default, the neoforge-manifest-new.xml-file resides in the manifests-directory inside ServerPackCreators home-directory.

      • getFabricVersionManifest

         final File getFabricVersionManifest()

        Fabric version manifest containing information about available Fabric loader versions.

        By default, the fabric-manifest.xml-file resides in the manifests-directory inside ServerPackCreators home-directory.

      • getMinecraftServerManifestsDirectory

         final File getMinecraftServerManifestsDirectory()

        Directory to which Minecraft server manifests are copied during the startup of ServerPackCreator.

        When the de.griefed.serverpackcreator.api.versionmeta.VersionMeta is initialized, the manifests copied to this directory will provide ServerPackCreator with the information required to check and create your server packs.

        The Minecraft server manifests contain information about the Java version required, the download-URL of the server-JAR and much more.

        By default, this is the mcserver-directory inside the manifests-directory inside ServerPackCreators home-directory.

      • getMinecraftVersionManifest

         final File getMinecraftVersionManifest()

        Minecraft version manifest containing information about available Minecraft versions.

        By default, the minecraft-manifest.json-file resides in the manifests-directory inside ServerPackCreators home-directory.

      • getWorkDirectory

         final File getWorkDirectory()

        Work-directory for storing temporary, non-critical, files and directories.

        Any file and/or directory inside the work-directory is considered safe-to-delete, meaning that it can safely be emptied when ServerPackCreator is not running, without running the risk of corrupting anything. It is not recommended to empty this directory whilst ServerPackCreator is running, as in that case, it may interfere with any currently running operation.

        By default, this is the work-directory inside ServerPackCreators home-directory.

      • getInstallerCacheDirectory

         final File getInstallerCacheDirectory()

        Caching directory for various types of installers. Mainly used by the version-meta for caching modloaders server installers, but also used as the ServerPackCreator installer cache-directory in certain scenarios.

      • getTempDirectory

         final File getTempDirectory()

        Temp-directory storing files and folders required temporarily during the run of a server pack generation or other operations.

        One example would be when running ServerPackCreator as a webservice and uploading a zipped modpack for the automatic creation of a server pack from said modpack.

        Any file and/or directory inside the work-directory is considered safe-to-delete, meaning that it can safely be emptied when ServerPackCreator is not running, without running the risk of corrupting anything. It is not recommended to empty this directory whilst ServerPackCreator is running, as in that case, it may interfere with any currently running operation.

        By default, this directory is work/temp inside ServerPackCreators home-directory.

      • getModpacksDirectory

         final File getModpacksDirectory()

        Modpacks directory in which uploaded modpack ZIP-archives and extracted modpacks are stored.

        By default, this is the modpacks-directory inside the temp-directory inside ServerPackCreators home-directory.

      • getServerFilesDirectory

         final File getServerFilesDirectory()

        Directory in which default server-files are stored in.

        Default server-files are, for example, the server.properties, server-icon.png, default_template.sh and default_template.ps1.

        The properties and icon are placeholders and/or templates for the user to change to their liking, should they so desire. The script-templates serve as a one-size-fits-all template for supporting Forge, Fabric, LegacyFabric and Quilt.

        By default, this directory is server_files inside ServerPackCreators home-directory.

      • getDefaultShellScriptTemplate

         final File getDefaultShellScriptTemplate()

        The default shell-template for the modded server start scripts. The file returned by this method does not represent the script-template in the server_files-directory. If you wish access the configured script templates inside the server_files-directory, use startScriptTemplates.

      • getDefaultFishScriptTemplate

         final File getDefaultFishScriptTemplate()

        The default fish-template for the modded server start scripts. The file returned by this method does not represent the script-template in the server_files-directory. If you wish access the configured script templates inside the server_files-directory, use startScriptTemplates.

      • getDefaultPowerShellScriptTemplate

         final File getDefaultPowerShellScriptTemplate()

        The default PowerShell-template for the modded server start scripts. The file returned by this method does not represent the script-template in the server_files-directory. If you wish access the configured script templates inside the server_files-directory, use startScriptTemplates.

      • getDefaultBatchScriptTemplate

         final File getDefaultBatchScriptTemplate()

        The default Batch-template for the modded server start scripts. The file returned by this method does not represent the script-template in the server_files-directory. If you wish access the configured script templates inside the server_files-directory, use startScriptTemplates.

      • getDefaultJavaShellScriptTemplate

         final File getDefaultJavaShellScriptTemplate()

        The default shell-template for the java-install scripts. The file returned by this method does not represent the script-template in the server_files-directory. If you wish access the configured script templates inside the server_files-directory, use javaScriptTemplates.

      • getDefaultJavaFishScriptTemplate

         final File getDefaultJavaFishScriptTemplate()

        The default fish-template for the java-install scripts. The file returned by this method does not represent the script-template in the server_files-directory. If you wish access the configured script templates inside the server_files-directory, use javaScriptTemplates.

      • getDefaultJavaPowerShellScriptTemplate

         final File getDefaultJavaPowerShellScriptTemplate()

        The default PowerShell-template for the java-install scripts. The file returned by this method does not represent the script-template in the server_files-directory. If you wish access the configured script templates inside the server_files-directory, use javaScriptTemplates.

      • getDefaultJavaBatchScriptTemplate

         final File getDefaultJavaBatchScriptTemplate()

        The path a Batch template for the java-install scripts would have, if one existed.

        Nothing is behind this path and nothing ever was. No default_java_template.bat ships in the jar, none is staged into server_files, and ScriptTemplatesConfig registers no bat key for Java installers - because start.bat is a wrapper that runs start.ps1, which sources install_java.ps1. Pointing a de.griefed.serverpackcreator.serverpack.java.template.bat property at this file yields an install_java.bat with nothing in it.

      • getPropertiesDirectory

         final File getPropertiesDirectory()

        Directory in which the properties for quick selection are to be stored in and retrieved from.

      • getIconsDirectory

         final File getIconsDirectory()

        Directory in which the icons for quick selection are to be stored in and retrieved from.

      • getDefaultServerProperties

         final File getDefaultServerProperties()

        Default server.properties-file used by Minecraft servers. This file resides in the server_files-directory inside ServerPackCreators home-directory.

      • getDefaultServerIcon

         final File getDefaultServerIcon()

        Default server-icon.png-file used by Minecraft servers. This file resides in the server_files-directory inside ServerPackCreators home-directory.

      • getDefaultVariablesTemplate

         final File getDefaultVariablesTemplate()

        The variables.txt template shipped with SPC, in the server_files-directory inside its home-directory.

        Generation reads this file and substitutes its SPC_..._SPC placeholders per server pack, so the text an operator sees — the comments explaining every setting — is editable without rebuilding the API. It sits alongside the start-script templates because it is the same kind of thing: shipped content the user may adjust.

      • getPluginsDirectory

         final File getPluginsDirectory()

        Directory in which plugins for ServerPackCreator are to be placed in.

        This directory not only holds any potential plugins for ServerPackCreator, but also contains the directory in which plugin-specific config-files are stored in, as well as the disabled.txt-file, which allows a user to disable any installed plugin.

        By default, this is the plugins-directory inside the ServerPackCreator home-directory.

      • getPluginsConfigsDirectory

         final File getPluginsConfigsDirectory()

        Directory in which plugin-specific configurations are stored in.

        When ServerPackCreator starts and loads all available plugins, it will also extract a plugins config-file, if available. This file will be stored inside the config-directory using the ID of the plugin as its name, with .toml appended to it. Think of this like the config-directory in a modded Minecraft server. Do the names of the config-files there look familiar to the mods they belong to? Well, they should!

        By default, this is the config-directory inside the plugins-directory inside ServerPackCreators home-directory.

      • defaultTomcatBaseDirectory

         final File defaultTomcatBaseDirectory()

        Where the web backend's Tomcat keeps its working files: always the home directory.

        Landmine: the tomcatBaseDirectory getter resets a deviating stored value to this on read, so the GUI's dirty-check compares a raw widget against a normalised value and needs a reload after saving.

      • defaultTomcatLogsDirectory

         final File defaultTomcatLogsDirectory()

        Where the web backend logs, falling back when the configured location is not writable.