@Component
public final class ApplicationProperties
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ApplicationProperties.ExclusionFilter |
| Constructor and Description |
|---|
ApplicationProperties(@NotNull java.io.File propertiesFile,
@NotNull FileUtilities fileUtilities,
@NotNull SystemUtilities systemUtilities,
@NotNull ListUtilities listUtilities,
@NotNull JarUtilities jarUtilities)
Initialize an instance of our application properties using a custom properties-file.
|
ApplicationProperties(@NotNull FileUtilities fileUtilities,
@NotNull SystemUtilities systemUtilities,
@NotNull ListUtilities listUtilities,
@NotNull JarUtilities jarUtilities)
Initialize an instance of our application properties using the default
serverpackcreator.properties. |
| Modifier and Type | Method and Description |
|---|---|
@NotNull java.io.File |
addonConfigsDirectory()
Directory in which addon-specific configurations are stored in.
|
@NotNull java.io.File |
addonsDirectory()
Directory in which addons for ServerPackCreator are to be placed in.
|
boolean |
checkForAvailablePreReleases()
Getter for whether the search for available PreReleases is enabled or disabled.
Depending on de.griefed.serverpackcreator.versioncheck.prerelease, returns true if checks
for available PreReleases are enabled, false if no checks for available PreReleases
should be made. |
@NotNull java.io.File |
defaultConfig()
Default configuration-file for a server pack generation inside ServerPackCreators
home-directory.
|
@NotNull java.io.File |
defaultPowershellTemplate()
The default PowerShell-template for the modded server start scripts.
|
@NotNull java.io.File |
defaultServerIcon()
Default server-icon.png-file used by Minecraft servers.
|
@NotNull java.io.File |
defaultServerProperties()
Default server.properties-file used by Minecraft servers.
|
@NotNull java.io.File |
defaultShellTemplate()
The default shell-template for the modded server start scripts.
|
boolean |
enableMinecraftPreReleases()
Whether Minecraft pre-releases and snapshots are available to the user in, for example, the
GUI.
|
@NotNull ApplicationProperties.ExclusionFilter |
exclusionFilter()
The filter method with which to determine whether a user-specified clientside-only mod should
be excluded from the server pack.
|
@NotNull java.io.File |
fabricInstallerManifest()
Fabric installer manifest containing information about available Fabric installers with which
to install a server.
|
@NotNull java.io.File |
fabricIntermediariesManifest()
The Fabric intermediaries manifest containing all required information about Fabrics
intermediaries.
|
@NotNull java.io.File |
fabricVersionManifest()
Fabric version manifest containing information about available Fabric loader versions.
|
@NotNull java.io.File |
forgeVersionManifest()
Forge version manifest containing information about available Forge loader versions.
|
@NotNull java.lang.String |
getAikarsFlags()
Get this configurations AikarsFlags
|
@NotNull java.util.List<java.lang.String> |
getDirectoriesToExclude()
Getter for the list of directories to exclude from server packs.
|
@NotNull java.util.List<java.lang.String> |
getDirectoriesToInclude()
Getter for the default list of directories to include in a server pack.
|
@NotNull java.util.List<java.lang.String> |
getFilesToExcludeFromZipArchive()
List of files to be excluded from ZIP-archives.
|
@NotNull java.lang.String |
getHasteBinServerUrl()
Acquire this instances HasteBin server documents endpoint URL.
|
@NotNull java.io.File |
getJarFile()
The .exe or JAR-file of ServerPackCreator.
|
@NotNull java.io.File |
getJarFolder()
The folder containing the ServerPackCreator.exe or JAR-file.
|
@NotNull java.lang.String |
getJarName()
The name of the .exe or JAR-file.
|
@NotNull java.lang.String |
getJavaVersion()
The Java version used to run ServerPackCreator.
|
@NotNull java.lang.String |
getLanguage()
Get the currently set language.
|
@NotNull java.util.List<java.lang.String> |
getListFallbackMods()
Acquire the default fallback list of clientside-only mods.
|
@NotNull java.lang.String |
getOSArch()
Architecture of the operating system on which ServerPackCreator is running on.
|
@NotNull java.lang.String |
getOSName()
The name of the operating system on which ServerPackCreator is running on.
|
@NotNull java.lang.String |
getOSVersion()
The version of the OS on which ServerPackCreator is running on.
|
int |
getQueueMaxDiskUsage()
Getter for the maximum disk usage at which JMS/Artemis will stop storing queues on disk.
|
boolean |
getSaveLoadedConfiguration()
Getter for whether the last loaded configuration file should be saved to as well.
|
@NotNull java.io.File |
homeDirectory()
ServerPackCreators home directory, in which all important files and folders are stored in.
|
boolean |
isAutoExcludingModsEnabled()
Is auto excluding of clientside-only mods enabled.
|
boolean |
isDarkTheme()
Is the Dark Theme currently active?
|
boolean |
isExe()
Whether a .exe or JAR-file was used for running ServerPackCreator.
|
boolean |
isJavaScriptAutoupdateEnabled()
Whether to automatically update the
SPC_JAVA_SPC-placeholder in the script variables
table with a Java path matching the required Java version for the Minecraft server. |
boolean |
isServerPackCleanupEnabled()
Whether cleanup procedures after server pack generation are enabled.
|
boolean |
isServerPacksOverwriteEnabled()
Whether overwriting of already existing server packs is enabled.
|
boolean |
isZipFileExclusionEnabled()
Whether the exclusion of files from the ZIP-archive of the server pack is enabled.
|
java.lang.String |
java()
Getter for the path to the Java executable/binary.
|
boolean |
javaAvailable()
Whether a viable path to a Java executable or binary has been configured for
ServerPackCreator.
|
@NotNull java.util.Optional<java.lang.String> |
javaPath(int javaVersion)
Get the path to the specified Java executable/binary, wrapped in an
Optional for your
convenience. |
@NotNull java.io.File |
langDirectory()
Directory in which the language-properties for internationalization are stored in.
|
@NotNull java.io.File |
legacyFabricGameManifest()
The LegacyFabric game version manifest containing information about which Minecraft version
LegacyFabric is available for.
|
@NotNull java.io.File |
legacyFabricInstallerManifest()
LegacyFabric installer manifest containing information about available LegacyFabric installers
with which to install a server.
|
@NotNull java.io.File |
legacyFabricLoaderManifest()
LegacyFabric loader manifest containing information about Fabric loader maven versions.
|
void |
loadProperties()
Reload serverpackcreator.properties.
|
@NotNull java.io.File |
logsDirectory()
Storage location for logs created by ServerPackCreator.
|
@NotNull java.io.File |
manifestsDirectory()
Directory to which default/fallback manifests are copied to during the startup of
ServerPackCreator.
|
@NotNull java.io.File |
minecraftServerManifestsDirectory()
Directory to which Minecraft server manifests are copied during the startup of
ServerPackCreator.
|
@NotNull java.io.File |
minecraftVersionManifest()
Minecraft version manifest containing information about available Minecraft versions.
|
@NotNull java.io.File |
modpacksDirectory()
Modpacks directory in which uploaded modpack ZIP-archives and extracted modpacks are stored.
|
@NotNull java.io.File |
quiltInstallerManifest()
Quilt installer manifest containing information about available Quilt installers with which to
install a server.
|
@NotNull java.io.File |
quiltVersionManifest()
Quilt version manifest containing information about available Quilt loader versions.
|
void |
saveToDisk(@NotNull java.io.File propertiesFile)
Store the ApplicationProperties to disk, overwriting the existing one.
|
@NotNull java.util.List<java.io.File> |
scriptTemplates()
Configured list of script templates.
|
@NotNull java.io.File |
serverFilesDirectory()
Directory in which default server-files are stored in.
|
@NotNull java.io.File |
serverPackCreatorDatabase()
ServerPackCreator-database when running as a webservice.
|
@NotNull java.io.File |
serverPackCreatorPropertiesFile()
The
serverpackcreator.properties-file which both resulted from starting
ServerPackCreator and provided the settings, properties and configurations for the currently
running instance. |
@NotNull java.lang.String |
serverPackCreatorVersion()
Getter for the version of ServerPackCreator.
If a JAR-file compiled from a release-job from a CI/CD-pipeline is used, it should contain a VERSION.txt-file which contains the version of said release. |
@NotNull java.io.File |
serverPacksDirectory()
Directory in which generated server packs, or server packs being generated, are stored in, as
well as their ZIP-archives, if created.
|
void |
setJavaPath(@NotNull java.lang.String javaPath)
Setter for the path to the Java executable/binary.
|
void |
setLanguage(@NotNull java.lang.String locale)
Overwrite the language used so the next run of ServerPackCreator uses that language setting.
|
void |
setTheme(boolean dark)
Set the current theme to Dark Theme or Light Theme.
|
@NotNull java.lang.String[] |
supportedModloaders()
Modloaders supported by ServerPackCreator.
|
@NotNull java.io.File |
tempDirectory()
Temp-directory storing files and folders required temporarily during the run of a server pack
generation or other operations.
|
boolean |
updateFallback()
Update the fallback clientside-only modlist of our
serverpackcreator.properties from
the main-repository or one of its mirrors. |
@NotNull java.io.File |
workDirectory()
Work-directory for storing temporary, non-critical, files and directories.
|
@Autowired
public ApplicationProperties(@NotNull
@NotNull FileUtilities fileUtilities,
@NotNull
@NotNull SystemUtilities systemUtilities,
@NotNull
@NotNull ListUtilities listUtilities,
@NotNull
@NotNull JarUtilities jarUtilities)
serverpackcreator.properties.fileUtilities - Instance of FileUtilities for file-operations.systemUtilities - Instance of SystemUtilities to acquire the Java path
automatically.listUtilities - Used to print the configured fallback modlists in chunks.jarUtilities - Instance of JarUtilities used to acquire .exe or JAR-, as well
as system information.public ApplicationProperties(@NotNull
@NotNull java.io.File propertiesFile,
@NotNull
@NotNull FileUtilities fileUtilities,
@NotNull
@NotNull SystemUtilities systemUtilities,
@NotNull
@NotNull ListUtilities listUtilities,
@NotNull
@NotNull JarUtilities jarUtilities)
propertiesFile - The properties file from which to load the settings and configuration.fileUtilities - Instance of FileUtilities for file-operations.systemUtilities - Instance of SystemUtilities to acquire the Java path
automatically.listUtilities - Used to print the configured fallback modlists in chunks.jarUtilities - Instance of JarUtilities used to acquire .exe or JAR-, as well
as system information.public void loadProperties()
public void setJavaPath(@NotNull
@NotNull java.lang.String javaPath)
MUST NOT be a symbolic link, or link of any kind.
It must be a direct path!javaPath - The new Java path to store.public void saveToDisk(@NotNull
@NotNull java.io.File propertiesFile)
propertiesFile - The file to store the properties to.@NotNull public @NotNull java.io.File serverPackCreatorPropertiesFile()
serverpackcreator.properties-file which both resulted from starting
ServerPackCreator and provided the settings, properties and configurations for the currently
running instance.public java.lang.String java()
public boolean javaAvailable()
true if a viable path has been set.@NotNull public @NotNull java.io.File minecraftServerManifestsDirectory()
When the 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.
@NotNull public @NotNull java.io.File manifestsDirectory()
When the 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.
@NotNull public @NotNull java.io.File fabricIntermediariesManifest()
By default, the fabric-intermediaries-manifest.json-file resides in the
manifests-directory inside ServerPackCreators home-directory.
@NotNull public @NotNull java.io.File legacyFabricGameManifest()
By default, the legacy-fabric-game-manifest.json-file resides in the
manifests-directory inside ServerPackCreators home-directory.
@NotNull public @NotNull java.io.File legacyFabricLoaderManifest()
By default, the legacy-fabric-loader-manifest.json-file resides in the
manifests-directory inside ServerPackCreators home-directory.
@NotNull public @NotNull java.io.File legacyFabricInstallerManifest()
By default, the legacy-fabric-installer-manifest.xml-file resides in the
manifests-directory inside ServerPackCreators home-directory.
@NotNull public @NotNull java.io.File fabricInstallerManifest()
By default, the fabric-installer-manifest.xml-file resides in the
manifests-directory inside ServerPackCreators home-directory.
@NotNull public @NotNull java.io.File quiltVersionManifest()
By default, the quilt-manifest.xml-file resides in the manifests-directory
inside ServerPackCreators home-directory.
@NotNull public @NotNull java.io.File quiltInstallerManifest()
By default, the quilt-installer-manifest.xml-file resides in the
manifests-directory inside ServerPackCreators home-directory.
@NotNull public @NotNull java.io.File forgeVersionManifest()
By default, the forge-manifest.json-file resides in the manifests-directory
inside ServerPackCreators home-directory.
@NotNull public @NotNull java.io.File fabricVersionManifest()
By default, the fabric-manifest.xml-file resides in the manifests-directory
inside ServerPackCreators home-directory.
@NotNull public @NotNull java.io.File minecraftVersionManifest()
By default, the minecraft-manifest.json-file resides in the manifests-directory
inside ServerPackCreators home-directory.
@NotNull public @NotNull java.io.File modpacksDirectory()
By default, this is the modpacks-directory inside the temp-directory inside
ServerPackCreators home-directory.
@NotNull public @NotNull java.io.File tempDirectory()
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.
@NotNull public @NotNull java.io.File workDirectory()
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.
@NotNull public @NotNull java.io.File logsDirectory()
logs-directory
inside ServerPackCreators home-directory.@NotNull public @NotNull java.io.File defaultShellTemplate()
server_files-directory. If you
wish access the configured script templates inside the server_files-directory, use
scriptTemplates().@NotNull public @NotNull java.io.File defaultPowershellTemplate()
server_files-directory. If you
wish access the configured script templates inside the server_files-directory, use
scriptTemplates().@NotNull public @NotNull java.util.List<java.io.File> scriptTemplates()
server_files-directory.@NotNull public @NotNull java.io.File defaultConfig()
@NotNull public @NotNull java.io.File defaultServerProperties()
server_files-directory inside ServerPackCreators home-directory.@NotNull public @NotNull java.io.File serverFilesDirectory()
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.
@NotNull public @NotNull java.io.File defaultServerIcon()
server_files-directory inside ServerPackCreators home-directory.@NotNull public @NotNull java.io.File serverPackCreatorDatabase()
@NotNull public @NotNull java.io.File homeDirectory()
Stored in serverpackcreator.properties under the
de.griefed.serverpackcreator.home- property.
Every operation is based on this home-directory, with the exception being the
serverPacksDirectory(), which can be configured independently of ServerPackCreators
home-directory.
@NotNull public @NotNull java.io.File langDirectory()
These are copied from the JAR-file to this directory during the startup of ServerPackCreator. Users may edit them to their liking or use them as examples for adding additional languages to ServerPackCreator.
By default, this is the lang-directory inside ServerPackCreators home-directory.
@NotNull public @NotNull java.lang.String serverPackCreatorVersion()
dev.@NotNull public @NotNull java.lang.String[] supportedModloaders()
@NotNull public @NotNull java.io.File addonConfigsDirectory()
When ServerPackCreator starts and loads all available addons, it will also extract an addons
config-file, if available. This file will be stored inside the config-directory using the ID of
the addon 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.
@NotNull public @NotNull java.io.File addonsDirectory()
This directory not only holds any potential addons for ServerPackCreator, but also contains the
directory in which addon-specific config-files are stored in, as well as the
disabled.txt-file, which allows a user to disable any installed addon.
By default, this is the plugins-directory inside the ServerPackCreator home-directory.
@NotNull public @NotNull java.io.File serverPacksDirectory()
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.
@NotNull public @NotNull java.util.List<java.lang.String> getListFallbackMods()
de.griefed.serverpackcreator.serverpack.autodiscovery.filter is set to
ApplicationProperties.ExclusionFilter.REGEX, a regex fallback list is returned.@NotNull public @NotNull java.util.List<java.lang.String> getDirectoriesToInclude()
@NotNull public @NotNull java.util.List<java.lang.String> getDirectoriesToExclude()
public boolean getSaveLoadedConfiguration()
public int getQueueMaxDiskUsage()
public boolean checkForAvailablePreReleases()
de.griefed.serverpackcreator.versioncheck.prerelease, returns true if checks
for available PreReleases are enabled, false if no checks for available PreReleases
should be made.@NotNull public @NotNull java.lang.String getAikarsFlags()
@NotNull public @NotNull java.util.List<java.lang.String> getFilesToExcludeFromZipArchive()
MINECRAFT_VERSION - Will be replaced with the Minecraft version of the
server pack
MODLOADER - Will be replaced with the modloader of the server pack
MODLOADER_VERSION - Will be replaced with the modloader version of the
server pack
Should you want these filters to be expanded, open an issue on GitHub
public boolean isZipFileExclusionEnabled()
true if the exclusion is enabled.public boolean isAutoExcludingModsEnabled()
true if autodiscovery is enabled.public boolean updateFallback()
serverpackcreator.properties from
the main-repository or one of its mirrors.true if the fallback-property was updated.public boolean isDarkTheme()
true if the Dark Theme is active, otherwise false.public void setTheme(boolean dark)
dark - true to activate Dark Theme, false otherwise.public boolean isServerPacksOverwriteEnabled()
true if it is enabled.public boolean isServerPackCleanupEnabled()
true if it is enabled.@NotNull public @NotNull java.lang.String getLanguage()
public void setLanguage(@NotNull
@NotNull java.lang.String locale)
locale - The language to set for the next run.@NotNull public @NotNull java.lang.String getHasteBinServerUrl()
public boolean enableMinecraftPreReleases()
true if they are available.@NotNull public @NotNull ApplicationProperties.ExclusionFilter exclusionFilter()
@NotNull public @NotNull java.util.Optional<java.lang.String> javaPath(int javaVersion)
Optional for your
convenience.javaVersion - The Java version to acquire the path for.public boolean isJavaScriptAutoupdateEnabled()
SPC_JAVA_SPC-placeholder in the script variables
table with a Java path matching the required Java version for the Minecraft server.true if enabled.@NotNull public @NotNull java.io.File getJarFolder()
@NotNull public @NotNull java.io.File getJarFile()
@NotNull public @NotNull java.lang.String getJarName()
@NotNull public @NotNull java.lang.String getJavaVersion()
@NotNull public @NotNull java.lang.String getOSArch()
@NotNull public @NotNull java.lang.String getOSName()
@NotNull public @NotNull java.lang.String getOSVersion()
public boolean isExe()
true if a .exe was/is used.