Class ApiProperties
-
- All Implemented Interfaces:
@Plugin(name = "ServerPackCreatorConfigFactory", category = "Core") public final class ApiProperties extends ConfigurationFactoryBase settings of ServerPackCreator, such as working directories, default list of clientside-only mods, default list of directories to include in a server pack, script templates, java paths and much more.
Griefed
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classApiProperties.CustomXMLConfigurationCustom XmlConfiguration to pass our custom log4j2.xml config to log4j.
Set up the XML configuration with the passed context and config source. For the config source being used, ApiProperties.getConfiguration where multiple attempts at creating a new private val log by lazy { cachedLoggerOf(this.javaClass) } using our own log4j2.xml are made before the default log4j setup is used.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ApiProperties(File propertiesFile)
-
Method Summary
Modifier and Type Method Description final FilegetHome()Default home-directory for ServerPackCreator. final GenerationConfiggetGenerationConfig()Settings-group for server pack generation: mod-lists, directory in-/exclusions, cleanup-files, ZIP-exclusions, exclusion-filter, generation-flags and Aikar's flags. final NetworkConfiggetNetworkConfig()Settings-group for the timeouts applied to every outbound HTTP call. final TreeSet<String>getFallbackDirectoriesInclusion()Fallback-list of directories to include in a server pack. final TreeSet<String>getFallbackDirectoriesExclusion()Fallback-list of directories to exclude from a server pack. final TreeSet<String>getFallbackZipExclusions()Fallback-list of files to exclude from the server pack ZIP-archive. final TreeSet<String>getFallbackPostInstallCleanupFiles()Fallback-list of files to delete after a modloader-server installation. final TreeSet<String>getFallbackPreInstallCleanupFiles()Fallback-list of files to delete before a modloader-server installation. final StringgetFallbackAikarsFlags()Fallback Aikar's flags for the generated start-scripts. final StringgetFallbackUpdateURL()Shipped default for the update-check URL, used when no property overrides it. final ExclusionFiltergetFallbackExclusionFilter()Default matching mode for clientside-mod exclusions (start/end/contains/regex). final BooleangetFallbackOverwriteEnabled()Whether an existing server pack is overwritten instead of the run aborting. final BooleangetFallbackJavaScriptAutoupdateEnabled()Whether the generated Java-install helper scripts are refreshed on each generation. final BooleangetFallbackCheckingForPreReleasesEnabled()Whether update checks consider alpha/beta releases as well as stable ones. final BooleangetFallbackZipFileExclusionEnabled()Whether the ZIP-exclusion list is applied when archiving a finished pack. final BooleangetFallbackServerPackCleanupEnabled()Whether post-install cleanup runs, deleting installer leftovers from the finished pack. final BooleangetFallbackMinecraftPreReleasesAvailabilityEnabled()Whether Minecraft snapshots and pre-releases are offered alongside releases. final BooleangetFallbackAutoExcludingModsEnabled()Whether the mod scanners exclude clientside mods automatically, on top of the configured list. final StringgetFallbackCleanupSchedule()Cron expression for the web backend's generic cleanup job. final StringgetFallbackVersionSchedule()Cron expression for refreshing the cached version manifests. final StringgetFallbackDatabaseCleanupSchedule()Cron expression for pruning old records from the web backend's database. final BooleangetFallbackUpdateServerPack()Whether regenerating a pack updates the existing directory instead of creating a new one. final I18n4kConfigDefaultgetI18n4kConfig()i18n4k's mutable configuration, held here because the locale setting is applied through it. final UpdateConfiggetUpdateConfig()Settings-group for update- and release-tracking. final I18nConfiggetI18nConfig()Settings-group for ServerPackCreators language. final LoggingConfiggetLoggingConfig()Settings-group for ServerPackCreators log-level. final TreeSet<String>getClientsideMods()String-list of clientside-only mods to exclude from server packs. final TreeSet<String>getModsWhitelist()String-list of mods to include if present, regardless whether a match was found through clientsideMods. final TreeSet<String>getClientsideModsRegex()Regex-list of clientside-only mods to exclude from server packs. final TreeSet<String>getModsWhitelistRegex()Regex-list of mods to include if present, regardless whether a match was found throug clientsideModsRegex. final IntegergetNetworkConnectTimeout()Milliseconds to wait for an HTTP connection to be established before giving up. final UnitsetNetworkConnectTimeout(Integer value)Milliseconds to wait for an HTTP connection to be established before giving up. final IntegergetNetworkReadTimeout()Milliseconds a single read of a metadata response may block before the call gives up. final UnitsetNetworkReadTimeout(Integer value)Milliseconds a single read of a metadata response may block before the call gives up. final IntegergetNetworkDownloadReadTimeout()Milliseconds a single read of a file-download may block before the download is abandoned. final UnitsetNetworkDownloadReadTimeout(Integer value)Milliseconds a single read of a file-download may block before the download is abandoned. final Array<String>getSupportedModloaders()Modloaders supported by ServerPackCreator. final StringgetApiVersion()This build's version from the jar manifest, or devwhen running from a source build.final BooleangetDevBuild()Whether this is a source build. final BooleangetPreRelease()Whether this build is an alpha or beta, which relaxes the same behaviours as devBuild. final StringgetConfigVersion()Config-format version stamped into generated .conffiles, so migrations know what they are reading.final BooleangetFirstRun()Only the first call to this property will return true if this is the first time ServerPackCreator is being run on a given host. final StringgetLogLevel()Log level SPC runs at. final UnitsetLogLevel(String value)Log level SPC runs at. final TreeSet<String>getDirectoriesToInclude()Directories to include in a server pack. final UnitsetDirectoriesToInclude(TreeSet<String> value)Directories to include in a server pack. final TreeSet<String>getDirectoriesToExclude()Directories to exclude from a server pack. final UnitsetDirectoriesToExclude(TreeSet<String> value)Directories to exclude from a server pack. final TreeSet<String>getPostInstallCleanupFiles()List of files to delete after a server pack server installation. final UnitsetPostInstallCleanupFiles(TreeSet<String> value)List of files to delete after a server pack server installation. final TreeSet<String>getPreInstallCleanupFiles()List of files to delete before a server pack server installation. final UnitsetPreInstallCleanupFiles(TreeSet<String> value)List of files to delete before a server pack server installation. final TreeSet<String>getZipArchiveExclusions()List of files to be excluded from ZIP-archives. final UnitsetZipArchiveExclusions(TreeSet<String> value)List of files to be excluded from ZIP-archives. final JavaConfiggetJavaConfig()Settings-group for Java-installations: the Java used for modloader-server installs, the per-version java-paths for script-variables, path-validation and the script-autoupdate flag. final HashMap<String, String>getJavaPaths()Paths to Java installations available to SPC for automatically updating the script variables of a given server pack configuration. final UnitsetJavaPaths(HashMap<String, String> value)Paths to Java installations available to SPC for automatically updating the script variables of a given server pack configuration. final TreeSet<File>getScriptTemplates()Deprecated list-based script-templates. final UnitsetScriptTemplates(TreeSet<File> value)Deprecated list-based script-templates. final HashMap<String, String>getStartScriptTemplates()Start-script templates to use during server pack generation, one entry per script-type. final UnitsetStartScriptTemplates(HashMap<String, String> value)Start-script templates to use during server pack generation, one entry per script-type. final HashMap<String, String>getJavaScriptTemplates()Java-install-script templates to use during server pack generation, one entry per script-type. final UnitsetJavaScriptTemplates(HashMap<String, String> value)Java-install-script templates to use during server pack generation, one entry per script-type. final URLgetUpdateUrl()The URL from which a .properties-file is read during updating of the fallback clientside-mods list. final UnitsetUpdateUrl(URL value)The URL from which a .properties-file is read during updating of the fallback clientside-mods list. final ExclusionFiltergetExclusionFilter()The filter method with which to determine whether a user-specified clientside-only mod should be excluded from the server pack. final UnitsetExclusionFilter(ExclusionFilter value)The filter method with which to determine whether a user-specified clientside-only mod should be excluded from the server pack. final BooleanisCheckingForPreReleasesEnabled()Whether the search for available PreReleases is enabled or disabled. final UnitsetCheckingForPreReleasesEnabled(Boolean value)Whether the search for available PreReleases is enabled or disabled. final BooleanisZipFileExclusionEnabled()Whether the exclusion of files from the ZIP-archive of the server pack is enabled. final UnitsetZipFileExclusionEnabled(Boolean value)Whether the exclusion of files from the ZIP-archive of the server pack is enabled. final BooleanisAutoExcludingModsEnabled()Is auto excluding of clientside-only mods enabled. final UnitsetAutoExcludingModsEnabled(Boolean value)Is auto excluding of clientside-only mods enabled. final BooleanisServerPacksOverwriteEnabled()Whether overwriting of already existing server packs is enabled. final UnitsetServerPacksOverwriteEnabled(Boolean value)Whether overwriting of already existing server packs is enabled. final BooleanisServerPackCleanupEnabled()Whether cleanup procedures after server pack generation are enabled. final UnitsetServerPackCleanupEnabled(Boolean value)Whether cleanup procedures after server pack generation are enabled. final BooleanisMinecraftPreReleasesAvailabilityEnabled()Whether Minecraft pre-releases and snapshots are available to the user in, for example, the GUI. final UnitsetMinecraftPreReleasesAvailabilityEnabled(Boolean value)Whether Minecraft pre-releases and snapshots are available to the user in, for example, the GUI. final BooleanisUpdatingServerPacksEnabled()Whether a server pack should be updated instead of cleanly generated. final UnitsetUpdatingServerPacksEnabled(Boolean value)Whether a server pack should be updated instead of cleanly generated. final TreeSet<String>getUpdateProtectedPaths()Paths an update must never delete, overwrite or put into the ZIP-archive, relative to the server pack. final UnitsetUpdateProtectedPaths(TreeSet<String> value)Paths an update must never delete, overwrite or put into the ZIP-archive, relative to the server pack. final TreeSet<String>getFallbackUpdateProtectedPaths()Shipped default for updateProtectedPaths. final BooleanisJavaScriptAutoupdateEnabled()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. final UnitsetJavaScriptAutoupdateEnabled(Boolean value)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. final StringgetAikarsFlags()Aikars Flags commonly used for Minecraft servers to improve performance in various places. final UnitsetAikarsFlags(String value)Aikars Flags commonly used for Minecraft servers to improve performance in various places. final WebserviceConfiggetWebserviceConfig()Web-service settings-group: database-URI and webservice-schedules. final StringgetDatabaseUri()Path to the database used by the webservice-side of ServerPackCreator. final UnitsetDatabaseUri(String value)Path to the database used by the webservice-side of ServerPackCreator. final LocalegetLanguage()Language used by ServerPackCreator. final UnitsetLanguage(Locale value)Language used by ServerPackCreator. final StringgetHasteBinServerUrl()URL to the HasteBin server where logs and configs are uploaded to. final UnitsetHasteBinServerUrl(String value)URL to the HasteBin server where logs and configs are uploaded to. final StringgetJavaPath()Java installation used for installing the modloader server during server pack creation. final UnitsetJavaPath(String value)Java installation used for installing the modloader server during server pack creation. final StringgetWebserviceCleanupSchedule()Cron-schedule of the webservice's cleanup-job. final UnitsetWebserviceCleanupSchedule(String value)Cron-schedule of the webservice's cleanup-job. final StringgetWebserviceVersionSchedule()Cron-schedule of the webservice's version-refresh-job. final UnitsetWebserviceVersionSchedule(String value)Cron-schedule of the webservice's version-refresh-job. final StringgetWebserviceDatabaseCleanupSchedule()Cron-schedule of the webservice's file-cleanup-job. final UnitsetWebserviceDatabaseCleanupSchedule(String value)Cron-schedule of the webservice's file-cleanup-job. final PathsConfiggetPathsConfig()Settings-group for ServerPackCreators home-directory and every directory and file derived from it. final ScriptTemplatesConfiggetScriptTemplatesConfig()Settings-group for the start- and java-script-templates. final FilegetHomeDirectory()ServerPackCreators home-directory, in which all important files and folders are stored in. final UnitsetHomeDirectory(File value)ServerPackCreators home-directory, in which all important files and folders are stored in. final FilegetServerPackCreatorPropertiesFile()The serverpackcreator.properties-file of the currently running instance. final FilegetOverridesPropertiesFile()Overrides-file which overrides any property set in the regular properties-file. final FilegetDefaultConfig()Default configuration-file for a server pack generation in the home-directory. final FilegetConfigsDirectory()Directory in which GUI-created configurations are saved by default. final FilegetTomcatBaseDirectory()Base-directory for Tomcat, used by the webservice-side of ServerPackCreator. final UnitsetTomcatBaseDirectory(File value)Base-directory for Tomcat, used by the webservice-side of ServerPackCreator. final FilegetServerPacksDirectory()Directory in which generated server packs and their ZIP-archives are stored. final UnitsetServerPacksDirectory(File value)Directory in which generated server packs and their ZIP-archives are stored. final FilegetLogsDirectory()Storage-location for logs created by ServerPackCreator. final FilegetTomcatLogsDirectory()Logs-directory for Tomcat, used by the webservice-side of ServerPackCreator. final UnitsetTomcatLogsDirectory(File value)Logs-directory for Tomcat, used by the webservice-side of ServerPackCreator. final FilegetManifestsDirectory()Directory to which default/fallback version-manifests are copied during startup. final FilegetFabricIntermediariesManifest()The Fabric intermediaries-manifest, used by Quilt, Fabric and LegacyFabric. final FilegetLegacyFabricGameManifest()The LegacyFabric game-version manifest. final FilegetLegacyFabricLoaderManifest()The LegacyFabric loader-manifest. final FilegetLegacyFabricInstallerManifest()The LegacyFabric installer-manifest. final FilegetFabricInstallerManifest()The Fabric installer-manifest. final FilegetQuiltVersionManifest()The Quilt version-manifest. final FilegetQuiltInstallerManifest()The Quilt installer-manifest. final FilegetForgeVersionManifest()The Forge version-manifest. final FilegetOldNeoForgeVersionManifest()The old NeoForge version-manifest, covering Minecraft 1.20.1 only. final FilegetNewNeoForgeVersionManifest()The new NeoForge version-manifest. final FilegetFabricVersionManifest()The Fabric version-manifest. final FilegetMinecraftServerManifestsDirectory()Directory in which Minecraft-server manifests are stored. final FilegetMinecraftVersionManifest()The Minecraft version-manifest. final FilegetWorkDirectory()Work-directory for storage of files and folders required temporarily during any operation. final FilegetInstallerCacheDirectory()Caching-directory for various types of installers. final FilegetTempDirectory()Temp-directory storing files and folders required temporarily during a run. final FilegetModpacksDirectory()Modpacks-directory in which uploaded modpack-archives and extracted modpacks are stored. final FilegetServerFilesDirectory()Directory in which default server-files are stored in. final FilegetDefaultShellScriptTemplate()The default shell-template for the modded server start-scripts. final FilegetDefaultFishScriptTemplate()The default fish-template for the modded server start-scripts. final FilegetDefaultPowerShellScriptTemplate()The default PowerShell-template for the modded server start-scripts. final FilegetDefaultBatchScriptTemplate()The default Batch-template for the modded server start-scripts. final FilegetDefaultJavaShellScriptTemplate()The default shell-template for the java-install scripts. final FilegetDefaultJavaFishScriptTemplate()The default fish-template for the java-install scripts. final FilegetDefaultJavaPowerShellScriptTemplate()The default PowerShell-template for the java-install scripts. final FilegetDefaultJavaBatchScriptTemplate()The path a Batch template for the java-install scripts would have - see the deprecation. final FilegetPropertiesDirectory()Directory in which properties for quick selection are stored and retrieved. final FilegetIconsDirectory()Directory in which icons for quick selection are stored and retrieved. final FilegetDefaultServerProperties()Default server.properties-file used by Minecraft servers. final FilegetDefaultServerIcon()Default server-icon.png-file used by Minecraft servers. final FilegetDefaultVariablesTemplate()The shipped variables.txttemplate that server-pack generation fills in.final FilegetPluginsDirectory()Directory in which plugins for ServerPackCreator are to be placed in. final FilegetPluginsConfigsDirectory()Directory in which plugin-specific configurations are stored in. final BooleangetFallbackUpdated()Whether the fallback lists for clientside-mods and whitelisted mods have been updated. final FilegetInstallLocationXml()log4j2.xmlbeside the jar rather than in the home directory — home is the jar folder, not SPC's home.final FilegetLog4jXml()The log4j2.xmlin SPC's home that logging is configured from; rewritten on a dev or pre-release build.final FilegetJarFolder()The folder containing the ServerPackCreator.exe or JAR-file. final BooleanisExe()Whether a .exe or JAR-file was used for running ServerPackCreator. final FilegetJarFile()The .exe or JAR-file of ServerPackCreator. final StringgetJarName()The name of the .exe or JAR-file. final StringgetJavaVersion()The Java version used to run ServerPackCreator. final StringgetOSArch()Architecture of the operating system on which ServerPackCreator is running on. final StringgetOSName()The name of the operating system on which ServerPackCreator is running on. final StringgetOSVersion()The version of the OS on which ServerPackCreator is running on. final Optional<String>getPreference(String pref, String def)Read one value from SPC's Preferencesnode, or def when unset.final UnitstorePreference(String pref, String value)Write one value into SPC's Preferencesnode.final List<File>defaultScriptTemplates()Default list of script templates used by ServerPackCreator. final HashMap<String, String>defaultStartScriptTemplates()Default map of start-script templates: sh, ps1, bat. final HashMap<String, String>defaultJavaScriptTemplates()Default map of java-install-script templates: sh, ps1. final Optional<String>javaPath(Integer javaVersion)Get the path to the specified Java executable/binary, wrapped in an Optional for your convenience. final Optional<String>javaPath(String javaVersion)Get the path to the specified Java executable/binary, wrapped in an Optional for your convenience. final StringdefaultWebserviceDatabase()The default webservice database-URI, for resetting the configuration to factory-state. final FiledefaultTomcatBaseDirectory()The default Tomcat base-directory: the home-directory. final FiledefaultServerPacksDirectory()The default server-packs directory: server-packs inside the home-directory. final FiledefaultTomcatLogsDirectory()The default Tomcat logs-directory: logs inside the home-directory. final UnitloadOverrides(File properties)Loads the overrides-properties directly into the store, replacing already-loaded values. final UnitloadProperties(Boolean saveProps)Load properties using the default file path. final UnitloadProperties(File propertiesFile, Boolean saveProps)Reload from a specific properties-file. final StringacquireJavaPath(String pathToJava)Check the given path to a Java installation for validity and return it, if it is valid. final UnitsaveProperties(File propertiesFile)Store the ApplicationProperties to disk, overwriting the existing one. final BooleanjavaAvailable()Whether a viable path to a Java executable or binary has been configured for ServerPackCreator. final UnitchangeLocale(Locale locale)Writes the specified locale from -lang your_locale to a lang.properties file to ensure every subsequent start of serverpackcreator is executed using said locale. final List<String>clientSideMods()Acquire the default fallback list of clientside-only mods. final List<String>whitelistedMods()Acquire the default fallback list of whitelisted mods. final BooleanupdateFallback()Update the fallback clientside-only mod-list and whitelist from the configured update-URL. final StringstoreCustomProperty(String property, String value)Store a custom property in the serverpackcreator.properties-file. final StringretrieveCustomProperty(String property)Retrieve a custom property in the serverpackcreator.properties-file. final UnitsetOldVersion(String version)Set the old version of ServerPackCreator used to perform necessary migrations between the old and the current version. final StringoldVersion()Get the old version of ServerPackCreator used to perform necessary migrations between the old and the current version. final UnitclearPropertyFileList()Forget every properties file the store has loaded from. Array<String>getSupportedTypes()ConfigurationgetConfiguration(LoggerContext loggerContext, ConfigurationSource source)Depending on whether this is the first run of ServerPackCreator on a users machine, the default log4j2 configuration may be present at different locations. final static StringgetSeparator()final static StringresolvePreferencesNode(String property, String environment)Decide which Preferencesnode to store settings in: the PREFERENCES_NODE_PROPERTY system property first, then the PREFERENCES_NODE_ENV environment variable, else DEFAULT_PREFERENCES_NODE.final static StringresolvePreferencesNode(String property)Decide which Preferencesnode to store settings in: the PREFERENCES_NODE_PROPERTY system property first, then the PREFERENCES_NODE_ENV environment variable, else DEFAULT_PREFERENCES_NODE.final static StringresolvePreferencesNode()Decide which Preferencesnode to store settings in: the PREFERENCES_NODE_PROPERTY system property first, then the PREFERENCES_NODE_ENV environment variable, else DEFAULT_PREFERENCES_NODE.-
Methods inherited from class org.apache.logging.log4j.core.config.ConfigurationFactory
getConfiguration, getConfiguration, getConfiguration, getDefaultPrefix, getInputFromString, getTestPrefix, getVersion, isActive -
Methods inherited from class de.griefed.serverpackcreator.api.ApiProperties
getSupportedTypes -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
ApiProperties
ApiProperties(File propertiesFile)
- Parameters:
propertiesFile- serverpackcreator.properties-file containing settings and configurations to load the API with.
-
-
Method Detail
-
getHome
final File getHome()
Default home-directory for ServerPackCreator. The directory containing the ServerPackCreator JAR.
-
getGenerationConfig
final GenerationConfig getGenerationConfig()
Settings-group for server pack generation: mod-lists, directory in-/exclusions, cleanup-files, ZIP-exclusions, exclusion-filter, generation-flags and Aikar's flags. Prefer accessing these values through this group; the individual properties on ApiProperties remain as facade.
-
getNetworkConfig
final NetworkConfig getNetworkConfig()
Settings-group for the timeouts applied to every outbound HTTP call. Prefer accessing these values through this group; the individual properties on ApiProperties remain as facade.
Declared here because it depends on nothing but store — and note that nothing in ApiProperties itself reads it, so the declaration-order landmine (Kotlin initialises properties in declaration order) does not bite: the only consumer is
WebUtilities, which reads it per call, long after construction.
-
getFallbackDirectoriesInclusion
final TreeSet<String> getFallbackDirectoriesInclusion()
Fallback-list of directories to include in a server pack.
-
getFallbackDirectoriesExclusion
final TreeSet<String> getFallbackDirectoriesExclusion()
Fallback-list of directories to exclude from a server pack.
-
getFallbackZipExclusions
final TreeSet<String> getFallbackZipExclusions()
Fallback-list of files to exclude from the server pack ZIP-archive.
-
getFallbackPostInstallCleanupFiles
final TreeSet<String> getFallbackPostInstallCleanupFiles()
Fallback-list of files to delete after a modloader-server installation.
-
getFallbackPreInstallCleanupFiles
final TreeSet<String> getFallbackPreInstallCleanupFiles()
Fallback-list of files to delete before a modloader-server installation.
-
getFallbackAikarsFlags
final String getFallbackAikarsFlags()
Fallback Aikar's flags for the generated start-scripts.
-
getFallbackUpdateURL
final String getFallbackUpdateURL()
Shipped default for the update-check URL, used when no property overrides it.
Every
fallback*member below is the same idea: the value SPC falls back on when the corresponding property is unset or invalid, delegated to whichever settings group owns it. They exist so a broken or missingserverpackcreator.propertiesstill yields a working configuration rather than an error.
-
getFallbackExclusionFilter
final ExclusionFilter getFallbackExclusionFilter()
Default matching mode for clientside-mod exclusions (start/end/contains/regex).
-
getFallbackOverwriteEnabled
final Boolean getFallbackOverwriteEnabled()
Whether an existing server pack is overwritten instead of the run aborting.
-
getFallbackJavaScriptAutoupdateEnabled
final Boolean getFallbackJavaScriptAutoupdateEnabled()
Whether the generated Java-install helper scripts are refreshed on each generation.
-
getFallbackCheckingForPreReleasesEnabled
final Boolean getFallbackCheckingForPreReleasesEnabled()
Whether update checks consider alpha/beta releases as well as stable ones.
-
getFallbackZipFileExclusionEnabled
final Boolean getFallbackZipFileExclusionEnabled()
Whether the ZIP-exclusion list is applied when archiving a finished pack.
-
getFallbackServerPackCleanupEnabled
final Boolean getFallbackServerPackCleanupEnabled()
Whether post-install cleanup runs, deleting installer leftovers from the finished pack.
-
getFallbackMinecraftPreReleasesAvailabilityEnabled
final Boolean getFallbackMinecraftPreReleasesAvailabilityEnabled()
Whether Minecraft snapshots and pre-releases are offered alongside releases.
-
getFallbackAutoExcludingModsEnabled
final Boolean getFallbackAutoExcludingModsEnabled()
Whether the mod scanners exclude clientside mods automatically, on top of the configured list.
-
getFallbackCleanupSchedule
final String getFallbackCleanupSchedule()
Cron expression for the web backend's generic cleanup job.
-
getFallbackVersionSchedule
final String getFallbackVersionSchedule()
Cron expression for refreshing the cached version manifests.
-
getFallbackDatabaseCleanupSchedule
final String getFallbackDatabaseCleanupSchedule()
Cron expression for pruning old records from the web backend's database.
-
getFallbackUpdateServerPack
final Boolean getFallbackUpdateServerPack()
Whether regenerating a pack updates the existing directory instead of creating a new one.
-
getI18n4kConfig
final I18n4kConfigDefault getI18n4kConfig()
i18n4k's mutable configuration, held here because the locale setting is applied through it.
-
getUpdateConfig
final UpdateConfig getUpdateConfig()
Settings-group for update- and release-tracking. Prefer accessing these values through this group; the individual properties on ApiProperties remain as facade.
-
getI18nConfig
final I18nConfig getI18nConfig()
Settings-group for ServerPackCreators language. Prefer accessing these values through this group; the individual properties on ApiProperties remain as facade.
-
getLoggingConfig
final LoggingConfig getLoggingConfig()
Settings-group for ServerPackCreators log-level. The log4j-XML machinery stays with ApiProperties, which acts as log4j's ConfigurationFactory.
-
getClientsideMods
final TreeSet<String> getClientsideMods()
String-list of clientside-only mods to exclude from server packs.
-
getModsWhitelist
final TreeSet<String> getModsWhitelist()
String-list of mods to include if present, regardless whether a match was found through clientsideMods.
-
getClientsideModsRegex
final TreeSet<String> getClientsideModsRegex()
Regex-list of clientside-only mods to exclude from server packs.
-
getModsWhitelistRegex
final TreeSet<String> getModsWhitelistRegex()
Regex-list of mods to include if present, regardless whether a match was found throug clientsideModsRegex.
-
getNetworkConnectTimeout
final Integer getNetworkConnectTimeout()
Milliseconds to wait for an HTTP connection to be established before giving up. Facade for NetworkConfig.connectTimeout.
-
setNetworkConnectTimeout
final Unit setNetworkConnectTimeout(Integer value)
Milliseconds to wait for an HTTP connection to be established before giving up. Facade for NetworkConfig.connectTimeout.
-
getNetworkReadTimeout
final Integer getNetworkReadTimeout()
Milliseconds a single read of a metadata response may block before the call gives up. Facade for NetworkConfig.readTimeout.
-
setNetworkReadTimeout
final Unit setNetworkReadTimeout(Integer value)
Milliseconds a single read of a metadata response may block before the call gives up. Facade for NetworkConfig.readTimeout.
-
getNetworkDownloadReadTimeout
final Integer getNetworkDownloadReadTimeout()
Milliseconds a single read of a file-download may block before the download is abandoned. Facade for NetworkConfig.downloadReadTimeout.
-
setNetworkDownloadReadTimeout
final Unit setNetworkDownloadReadTimeout(Integer value)
Milliseconds a single read of a file-download may block before the download is abandoned. Facade for NetworkConfig.downloadReadTimeout.
-
getSupportedModloaders
final Array<String> getSupportedModloaders()
Modloaders supported by ServerPackCreator.
-
getApiVersion
final String getApiVersion()
This build's version from the jar manifest, or
devwhen running from a source build.
-
getDevBuild
final Boolean getDevBuild()
Whether this is a source build. Widely consequential, not cosmetic: it turns on DEBUG logging, rewrites
log4j2.xmlon every start, and makes the home directory fall back to the working directory.
-
getPreRelease
final Boolean getPreRelease()
Whether this build is an alpha or beta, which relaxes the same behaviours as devBuild.
-
getConfigVersion
final String getConfigVersion()
Config-format version stamped into generated
.conffiles, so migrations know what they are reading.
-
getFirstRun
final Boolean getFirstRun()
Only the first call to this property will return true if this is the first time ServerPackCreator is being run on a given host. Any subsequent call will return false. Handle with care!
-
getLogLevel
final String getLogLevel()
Log level SPC runs at. Setting it rewrites log4jXml, so it takes effect without a restart.
-
setLogLevel
final Unit setLogLevel(String value)
Log level SPC runs at. Setting it rewrites log4jXml, so it takes effect without a restart.
-
getDirectoriesToInclude
final TreeSet<String> getDirectoriesToInclude()
Directories to include in a server pack.
-
setDirectoriesToInclude
final Unit setDirectoriesToInclude(TreeSet<String> value)
Directories to include in a server pack.
-
getDirectoriesToExclude
final TreeSet<String> getDirectoriesToExclude()
Directories to exclude from a server pack.
-
setDirectoriesToExclude
final Unit setDirectoriesToExclude(TreeSet<String> value)
Directories to exclude from a server pack.
-
getPostInstallCleanupFiles
final TreeSet<String> getPostInstallCleanupFiles()
List of files to delete after a server pack server installation.
-
setPostInstallCleanupFiles
final Unit setPostInstallCleanupFiles(TreeSet<String> value)
List of files to delete after a server pack server installation.
-
getPreInstallCleanupFiles
final TreeSet<String> getPreInstallCleanupFiles()
List of files to delete before a server pack server installation.
-
setPreInstallCleanupFiles
final Unit setPreInstallCleanupFiles(TreeSet<String> value)
List of files to delete before a server pack server installation.
-
getZipArchiveExclusions
final TreeSet<String> getZipArchiveExclusions()
List of files to be excluded from ZIP-archives. Current filters are:
MINECRAFT_VERSION- Will be replaced with the Minecraft version of the server packMODLOADER- Will be replaced with the modloader of the server packMODLOADER_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
-
setZipArchiveExclusions
final Unit setZipArchiveExclusions(TreeSet<String> value)
List of files to be excluded from ZIP-archives. Current filters are:
MINECRAFT_VERSION- Will be replaced with the Minecraft version of the server packMODLOADER- Will be replaced with the modloader of the server packMODLOADER_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
-
getJavaConfig
final JavaConfig getJavaConfig()
Settings-group for Java-installations: the Java used for modloader-server installs, the per-version java-paths for script-variables, path-validation and the script-autoupdate flag. Prefer accessing these values through this group; the individual properties on ApiProperties remain as facade.
-
getJavaPaths
final HashMap<String, String> getJavaPaths()
Paths to Java installations available to SPC for automatically updating the script variables of a given server pack configuration. Key: Java version, value: path.
-
setJavaPaths
final Unit setJavaPaths(HashMap<String, String> value)
Paths to Java installations available to SPC for automatically updating the script variables of a given server pack configuration. Key: Java version, value: path.
-
getScriptTemplates
final TreeSet<File> getScriptTemplates()
Deprecated list-based script-templates.
-
setScriptTemplates
final Unit setScriptTemplates(TreeSet<File> value)
Deprecated list-based script-templates.
-
getStartScriptTemplates
final HashMap<String, String> getStartScriptTemplates()
Start-script templates to use during server pack generation, one entry per script-type.
-
setStartScriptTemplates
final Unit setStartScriptTemplates(HashMap<String, String> value)
Start-script templates to use during server pack generation, one entry per script-type.
-
getJavaScriptTemplates
final HashMap<String, String> getJavaScriptTemplates()
Java-install-script templates to use during server pack generation, one entry per script-type.
-
setJavaScriptTemplates
final Unit setJavaScriptTemplates(HashMap<String, String> value)
Java-install-script templates to use during server pack generation, one entry per script-type.
-
getUpdateUrl
final URL getUpdateUrl()
The URL from which a .properties-file is read during updating of the fallback clientside-mods list.
-
setUpdateUrl
final Unit setUpdateUrl(URL value)
The URL from which a .properties-file is read during updating of the fallback clientside-mods list.
-
getExclusionFilter
final ExclusionFilter getExclusionFilter()
The filter method with which to determine whether a user-specified clientside-only mod should be excluded from the server pack. Available settings are:
-
setExclusionFilter
final Unit setExclusionFilter(ExclusionFilter value)
The filter method with which to determine whether a user-specified clientside-only mod should be excluded from the server pack. Available settings are:
-
isCheckingForPreReleasesEnabled
final Boolean isCheckingForPreReleasesEnabled()
Whether the search for available PreReleases is enabled or disabled. Depending on
de.griefed.serverpackcreator.versioncheck.prerelease, returnstrueif checks for available PreReleases are enabled,falseif no checks for available PreReleases should be made.
-
setCheckingForPreReleasesEnabled
final Unit setCheckingForPreReleasesEnabled(Boolean value)
Whether the search for available PreReleases is enabled or disabled. Depending on
de.griefed.serverpackcreator.versioncheck.prerelease, returnstrueif checks for available PreReleases are enabled,falseif no checks for available PreReleases should be made.
-
isZipFileExclusionEnabled
final Boolean isZipFileExclusionEnabled()
Whether the exclusion of files from the ZIP-archive of the server pack is enabled.
-
setZipFileExclusionEnabled
final Unit setZipFileExclusionEnabled(Boolean value)
Whether the exclusion of files from the ZIP-archive of the server pack is enabled.
-
isAutoExcludingModsEnabled
final Boolean isAutoExcludingModsEnabled()
Is auto excluding of clientside-only mods enabled.
-
setAutoExcludingModsEnabled
final Unit setAutoExcludingModsEnabled(Boolean value)
Is auto excluding of clientside-only mods enabled.
-
isServerPacksOverwriteEnabled
final Boolean isServerPacksOverwriteEnabled()
Whether overwriting of already existing server packs is enabled.
-
setServerPacksOverwriteEnabled
final Unit setServerPacksOverwriteEnabled(Boolean value)
Whether overwriting of already existing server packs is enabled.
-
isServerPackCleanupEnabled
final Boolean isServerPackCleanupEnabled()
Whether cleanup procedures after server pack generation are enabled.
-
setServerPackCleanupEnabled
final Unit setServerPackCleanupEnabled(Boolean value)
Whether cleanup procedures after server pack generation are enabled.
-
isMinecraftPreReleasesAvailabilityEnabled
final Boolean isMinecraftPreReleasesAvailabilityEnabled()
Whether Minecraft pre-releases and snapshots are available to the user in, for example, the GUI.
-
setMinecraftPreReleasesAvailabilityEnabled
final Unit setMinecraftPreReleasesAvailabilityEnabled(Boolean value)
Whether Minecraft pre-releases and snapshots are available to the user in, for example, the GUI.
-
isUpdatingServerPacksEnabled
final Boolean isUpdatingServerPacksEnabled()
Whether a server pack should be updated instead of cleanly generated.
-
setUpdatingServerPacksEnabled
final Unit setUpdatingServerPacksEnabled(Boolean value)
Whether a server pack should be updated instead of cleanly generated.
-
getUpdateProtectedPaths
final TreeSet<String> getUpdateProtectedPaths()
Paths an update must never delete, overwrite or put into the ZIP-archive, relative to the server pack. A directory covers everything beneath it. See de.griefed.serverpackcreator.api.settings.GenerationConfig.updateProtectedPaths.
-
setUpdateProtectedPaths
final Unit setUpdateProtectedPaths(TreeSet<String> value)
Paths an update must never delete, overwrite or put into the ZIP-archive, relative to the server pack. A directory covers everything beneath it. See de.griefed.serverpackcreator.api.settings.GenerationConfig.updateProtectedPaths.
-
getFallbackUpdateProtectedPaths
final TreeSet<String> getFallbackUpdateProtectedPaths()
Shipped default for updateProtectedPaths.
-
isJavaScriptAutoupdateEnabled
final 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.
-
setJavaScriptAutoupdateEnabled
final Unit setJavaScriptAutoupdateEnabled(Boolean value)
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.
-
getAikarsFlags
final String getAikarsFlags()
Aikars Flags commonly used for Minecraft servers to improve performance in various places.
-
setAikarsFlags
final Unit setAikarsFlags(String value)
Aikars Flags commonly used for Minecraft servers to improve performance in various places.
-
getWebserviceConfig
final WebserviceConfig getWebserviceConfig()
Web-service settings-group: database-URI and webservice-schedules. Prefer accessing these through this group; the individual properties on ApiProperties remain as facade.
-
getDatabaseUri
final String getDatabaseUri()
Path to the database used by the webservice-side of ServerPackCreator.
-
setDatabaseUri
final Unit setDatabaseUri(String value)
Path to the database used by the webservice-side of ServerPackCreator.
-
getLanguage
final Locale getLanguage()
Language used by ServerPackCreator.
-
setLanguage
final Unit setLanguage(Locale value)
Language used by ServerPackCreator.
-
getHasteBinServerUrl
final String getHasteBinServerUrl()
URL to the HasteBin server where logs and configs are uploaded to.
-
setHasteBinServerUrl
final Unit setHasteBinServerUrl(String value)
URL to the HasteBin server where logs and configs are uploaded to.
-
getJavaPath
final String getJavaPath()
Java installation used for installing the modloader server during server pack creation.
-
setJavaPath
final Unit setJavaPath(String value)
Java installation used for installing the modloader server during server pack creation.
-
getWebserviceCleanupSchedule
final String getWebserviceCleanupSchedule()
Cron-schedule of the webservice's cleanup-job. Facade for WebserviceConfig.cleanupSchedule.
-
setWebserviceCleanupSchedule
final Unit setWebserviceCleanupSchedule(String value)
Cron-schedule of the webservice's cleanup-job. Facade for WebserviceConfig.cleanupSchedule.
-
getWebserviceVersionSchedule
final String getWebserviceVersionSchedule()
Cron-schedule of the webservice's version-refresh-job. Facade for WebserviceConfig.versionSchedule.
-
setWebserviceVersionSchedule
final Unit setWebserviceVersionSchedule(String value)
Cron-schedule of the webservice's version-refresh-job. Facade for WebserviceConfig.versionSchedule.
-
getWebserviceDatabaseCleanupSchedule
final String getWebserviceDatabaseCleanupSchedule()
Cron-schedule of the webservice's file-cleanup-job. Facade for WebserviceConfig.databaseCleanupSchedule.
-
setWebserviceDatabaseCleanupSchedule
final Unit setWebserviceDatabaseCleanupSchedule(String value)
Cron-schedule of the webservice's file-cleanup-job. Facade for WebserviceConfig.databaseCleanupSchedule.
-
getPathsConfig
final PathsConfig getPathsConfig()
Settings-group for ServerPackCreators home-directory and every directory and file derived from it. Prefer accessing these values through this group; the individual properties on ApiProperties remain as facade.
-
getScriptTemplatesConfig
final ScriptTemplatesConfig getScriptTemplatesConfig()
Settings-group for the start- and java-script-templates. Prefer accessing these values through this group; the individual properties on ApiProperties remain as facade.
-
getHomeDirectory
final File getHomeDirectory()
ServerPackCreators home-directory, in which all important files and folders are stored in.
-
setHomeDirectory
final Unit setHomeDirectory(File value)
ServerPackCreators home-directory, in which all important files and folders are stored in.
-
getServerPackCreatorPropertiesFile
final File getServerPackCreatorPropertiesFile()
The serverpackcreator.properties-file of the currently running instance.
-
getOverridesPropertiesFile
final File getOverridesPropertiesFile()
Overrides-file which overrides any property set in the regular properties-file.
-
getDefaultConfig
final File getDefaultConfig()
Default configuration-file for a server pack generation in the home-directory.
-
getConfigsDirectory
final File getConfigsDirectory()
Directory in which GUI-created configurations are saved by default.
-
getTomcatBaseDirectory
final File getTomcatBaseDirectory()
Base-directory for Tomcat, used by the webservice-side of ServerPackCreator.
-
setTomcatBaseDirectory
final Unit setTomcatBaseDirectory(File value)
Base-directory for Tomcat, used by the webservice-side of ServerPackCreator.
-
getServerPacksDirectory
final File getServerPacksDirectory()
Directory in which generated server packs and their ZIP-archives are stored.
-
setServerPacksDirectory
final Unit setServerPacksDirectory(File value)
Directory in which generated server packs and their ZIP-archives are stored.
-
getLogsDirectory
final File getLogsDirectory()
Storage-location for logs created by ServerPackCreator.
-
getTomcatLogsDirectory
final File getTomcatLogsDirectory()
Logs-directory for Tomcat, used by the webservice-side of ServerPackCreator.
-
setTomcatLogsDirectory
final Unit setTomcatLogsDirectory(File value)
Logs-directory for Tomcat, used by the webservice-side of ServerPackCreator.
-
getManifestsDirectory
final File getManifestsDirectory()
Directory to which default/fallback version-manifests are copied during startup.
-
getFabricIntermediariesManifest
final File getFabricIntermediariesManifest()
The Fabric intermediaries-manifest, used by Quilt, Fabric and LegacyFabric.
-
getLegacyFabricGameManifest
final File getLegacyFabricGameManifest()
The LegacyFabric game-version manifest.
-
getLegacyFabricLoaderManifest
final File getLegacyFabricLoaderManifest()
The LegacyFabric loader-manifest.
-
getLegacyFabricInstallerManifest
final File getLegacyFabricInstallerManifest()
The LegacyFabric installer-manifest.
-
getFabricInstallerManifest
final File getFabricInstallerManifest()
The Fabric installer-manifest.
-
getQuiltVersionManifest
final File getQuiltVersionManifest()
The Quilt version-manifest.
-
getQuiltInstallerManifest
final File getQuiltInstallerManifest()
The Quilt installer-manifest.
-
getForgeVersionManifest
final File getForgeVersionManifest()
The Forge version-manifest.
-
getOldNeoForgeVersionManifest
final File getOldNeoForgeVersionManifest()
The old NeoForge version-manifest, covering Minecraft 1.20.1 only.
-
getNewNeoForgeVersionManifest
final File getNewNeoForgeVersionManifest()
The new NeoForge version-manifest.
-
getFabricVersionManifest
final File getFabricVersionManifest()
The Fabric version-manifest.
-
getMinecraftServerManifestsDirectory
final File getMinecraftServerManifestsDirectory()
Directory in which Minecraft-server manifests are stored.
-
getMinecraftVersionManifest
final File getMinecraftVersionManifest()
The Minecraft version-manifest.
-
getWorkDirectory
final File getWorkDirectory()
Work-directory for storage of files and folders required temporarily during any operation.
-
getInstallerCacheDirectory
final File getInstallerCacheDirectory()
Caching-directory for various types of installers.
-
getTempDirectory
final File getTempDirectory()
Temp-directory storing files and folders required temporarily during a run.
-
getModpacksDirectory
final File getModpacksDirectory()
Modpacks-directory in which uploaded modpack-archives and extracted modpacks are stored.
-
getServerFilesDirectory
final File getServerFilesDirectory()
Directory in which default server-files are stored in.
-
getDefaultShellScriptTemplate
final File getDefaultShellScriptTemplate()
The default shell-template for the modded server start-scripts.
-
getDefaultFishScriptTemplate
final File getDefaultFishScriptTemplate()
The default fish-template for the modded server start-scripts.
-
getDefaultPowerShellScriptTemplate
final File getDefaultPowerShellScriptTemplate()
The default PowerShell-template for the modded server start-scripts.
-
getDefaultBatchScriptTemplate
final File getDefaultBatchScriptTemplate()
The default Batch-template for the modded server start-scripts.
-
getDefaultJavaShellScriptTemplate
final File getDefaultJavaShellScriptTemplate()
The default shell-template for the java-install scripts.
-
getDefaultJavaFishScriptTemplate
final File getDefaultJavaFishScriptTemplate()
The default fish-template for the java-install scripts.
-
getDefaultJavaPowerShellScriptTemplate
final File getDefaultJavaPowerShellScriptTemplate()
The default PowerShell-template for the java-install scripts.
-
getDefaultJavaBatchScriptTemplate
final File getDefaultJavaBatchScriptTemplate()
The path a Batch template for the java-install scripts would have - see the deprecation.
-
getPropertiesDirectory
final File getPropertiesDirectory()
Directory in which properties for quick selection are stored and retrieved.
-
getIconsDirectory
final File getIconsDirectory()
Directory in which icons for quick selection are stored and retrieved.
-
getDefaultServerProperties
final File getDefaultServerProperties()
Default server.properties-file used by Minecraft servers.
-
getDefaultServerIcon
final File getDefaultServerIcon()
Default server-icon.png-file used by Minecraft servers.
-
getDefaultVariablesTemplate
final File getDefaultVariablesTemplate()
The shipped
variables.txttemplate that server-pack generation fills in. Lives in theserver_files-directory inside ServerPackCreator's home-directory, like the start-script templates.
-
getPluginsDirectory
final File getPluginsDirectory()
Directory in which plugins for ServerPackCreator are to be placed in.
-
getPluginsConfigsDirectory
final File getPluginsConfigsDirectory()
Directory in which plugin-specific configurations are stored in.
-
getFallbackUpdated
final Boolean getFallbackUpdated()
Whether the fallback lists for clientside-mods and whitelisted mods have been updated.
trueif either was updated.
-
getInstallLocationXml
final File getInstallLocationXml()
log4j2.xmlbeside the jar rather than in the home directory — home is the jar folder, not SPC's home. Legacy install-location copy; log4jXml is the one logging actually reads.
-
getLog4jXml
final File getLog4jXml()
The
log4j2.xmlin SPC's home that logging is configured from; rewritten on a dev or pre-release build.
-
getJarFolder
final File getJarFolder()
The folder containing the ServerPackCreator.exe or JAR-file.
- Returns:
Folder containing the ServerPackCreator.exe or JAR-file.
-
isExe
final Boolean isExe()
Whether a .exe or JAR-file was used for running ServerPackCreator.
- Returns:
trueif a .exe was/is used.
-
getJarFile
final File getJarFile()
The .exe or JAR-file of ServerPackCreator.
- Returns:
The .exe or JAR-file of ServerPackCreator.
-
getJarName
final String getJarName()
The name of the .exe or JAR-file.
- Returns:
The name of the .exe or JAR-file.
-
getJavaVersion
final String getJavaVersion()
The Java version used to run ServerPackCreator.
- Returns:
Java version.
-
getOSArch
final String getOSArch()
Architecture of the operating system on which ServerPackCreator is running on.
- Returns:
Arch.
-
getOSName
final String getOSName()
The name of the operating system on which ServerPackCreator is running on.
- Returns:
OS name.
-
getOSVersion
final String getOSVersion()
The version of the OS on which ServerPackCreator is running on.
- Returns:
Version of the OS.
-
getPreference
final Optional<String> getPreference(String pref, String def)
Read one value from SPC's
Preferencesnode, or def when unset.Landmine: which node that is depends on
resolvePreferencesNode— a host claiming its own node (the grinder daemon, every test JVM) reads and writes a different store than the default installation, deliberately.
-
storePreference
final Unit storePreference(String pref, String value)
Write one value into SPC's
Preferencesnode. Same node caveat as getPreference.
-
defaultScriptTemplates
@Deprecated(message = "Deprecated as of 6.0.0", replaceWith = @ReplaceWith(expression = "defaultStartScriptTemplates()")) final List<File> defaultScriptTemplates()
Default list of script templates used by ServerPackCreator.
-
defaultStartScriptTemplates
final HashMap<String, String> defaultStartScriptTemplates()
Default map of start-script templates: sh, ps1, bat.
-
defaultJavaScriptTemplates
final HashMap<String, String> defaultJavaScriptTemplates()
Default map of java-install-script templates: sh, ps1.
-
javaPath
final Optional<String> javaPath(Integer javaVersion)
Get the path to the specified Java executable/binary, wrapped in an Optional for your convenience.
-
javaPath
final Optional<String> javaPath(String javaVersion)
Get the path to the specified Java executable/binary, wrapped in an Optional for your convenience.
-
defaultWebserviceDatabase
final String defaultWebserviceDatabase()
The default webservice database-URI, for resetting the configuration to factory-state.
-
defaultTomcatBaseDirectory
final File defaultTomcatBaseDirectory()
The default Tomcat base-directory: the home-directory.
-
defaultServerPacksDirectory
final File defaultServerPacksDirectory()
The default server-packs directory: server-packs inside the home-directory.
-
defaultTomcatLogsDirectory
final File defaultTomcatLogsDirectory()
The default Tomcat logs-directory: logs inside the home-directory.
-
loadOverrides
final Unit loadOverrides(File properties)
Loads the overrides-properties directly into the store, replacing already-loaded values.
-
loadProperties
final Unit loadProperties(Boolean saveProps)
Load properties using the default file path. Only call this method on an already initialized ApiProperties-object.
-
loadProperties
final Unit loadProperties(File propertiesFile, Boolean saveProps)
Reload from a specific properties-file.
- Parameters:
propertiesFile- The properties-file with which to loadProperties the settings and configuration.
-
acquireJavaPath
final String acquireJavaPath(String pathToJava)
Check the given path to a Java installation for validity and return it, if it is valid. Invalid paths yield the automatically acquired system-Java.
-
saveProperties
final Unit saveProperties(File propertiesFile)
Store the ApplicationProperties to disk, overwriting the existing one.
- Parameters:
propertiesFile- The file to store the properties to.
-
javaAvailable
final Boolean javaAvailable()
Whether a viable path to a Java executable or binary has been configured for ServerPackCreator.
-
changeLocale
final Unit changeLocale(Locale locale)
Writes the specified locale from -lang your_locale to a lang.properties file to ensure every subsequent start of serverpackcreator is executed using said locale.
- Parameters:
locale- The locale the user specified when they ran serverpackcreator with -lang -your_locale.
-
clientSideMods
final List<String> clientSideMods()
Acquire the default fallback list of clientside-only mods. If
de.griefed.serverpackcreator.serverpack.autodiscovery.filteris set to ExclusionFilter.REGEX, a regex fallback list is returned.- Returns:
The fallback list of clientside-only mods.
-
whitelistedMods
final List<String> whitelistedMods()
Acquire the default fallback list of whitelisted mods. If
de.griefed.serverpackcreator.serverpack.autodiscovery.filteris set to ExclusionFilter.REGEX, a regex fallback list is returned.- Returns:
The fallback list of whitelisted mods.
-
updateFallback
final Boolean updateFallback()
Update the fallback clientside-only mod-list and whitelist from the configured update-URL.
- Returns:
trueif either fallback-list was updated.
-
storeCustomProperty
final String storeCustomProperty(String property, String value)
Store a custom property in the serverpackcreator.properties-file. Beware that every property you add receives a prefix, to prevent clashes with any other properties.
Said prefix consists of
custom.property.followed by the property you specified coming in last.Say you have a value in the property
saved, then the resulting property in the serverpackcreator.properties would be:custom.property.saved
-
retrieveCustomProperty
final String retrieveCustomProperty(String property)
Retrieve a custom property in the serverpackcreator.properties-file. Beware that every property you retrieve this way contains a prefix, to prevent clashes with any other properties.
Said prefix consists of
custom.property.followed by the property you specified coming in last.Say you have a property
saved, then the resulting property in the serverpackcreator.properties would be:custom.property.saved
-
setOldVersion
final Unit setOldVersion(String version)
Set the old version of ServerPackCreator used to perform necessary migrations between the old and the current version.
- Parameters:
version- Old version used before upgrading to the current version.
-
oldVersion
final String oldVersion()
Get the old version of ServerPackCreator used to perform necessary migrations between the old and the current version.
- Returns:
Old version used before updating. Empty if this is the first run of ServerPackCreator.
-
clearPropertyFileList
final Unit clearPropertyFileList()
Forget every properties file the store has loaded from.
PropertyStorewrites to all tracked files on every save, so a file loaded once keeps being rewritten for the life of the process — which is how a daemon started from a checkout dropped a settings file into the repository root. Call this when a host wants its saves confined to the file it just pointed SPC at.
-
getSupportedTypes
Array<String> getSupportedTypes()
-
getConfiguration
Configuration getConfiguration(LoggerContext loggerContext, ConfigurationSource source)
Depending on whether this is the first run of ServerPackCreator on a users machine, the default log4j2 configuration may be present at different locations. The default one is the config inside the home-directory of SPC, of which we will try to set up our logging with. If said file fails for whatever reason, we will try to use a config inside the directory from which SPC was executed. Should that fail, too, the config from the classpath is used, to ensure we always have default configs available. Should that fail, too, though, log4j is set up with its own default settings.
- Parameters:
loggerContext- logger context passed from log4j itselfsource- configuration source passed from log4j itself.- Returns:
Custom configuration with proper logs-directory set.
-
getSeparator
final static String getSeparator()
-
resolvePreferencesNode
@JvmOverloads() final static String resolvePreferencesNode(String property, String environment)
Decide which
Preferencesnode to store settings in: the PREFERENCES_NODE_PROPERTY system property first, then the PREFERENCES_NODE_ENV environment variable, else DEFAULT_PREFERENCES_NODE.Why this is overridable at all: the node is per-user and machine-wide, and
PathsConfig.homeDirectoryre-reads it on every access while writing back what it resolved. With a single hard-coded node, any SPC process could relocate any other running process's home directory — a test suite moved a live grinder daemon's home into its own scratch directory and then deleted it, and equally, running the suites moved the developer's own GUI home. Giving each host its own node makes that impossible.A blank override falls back to the default rather than being honoured:
userRoot().node("")is the root node, shared with every other Java application on the account.- Parameters:
property- The system-property value (injectable for tests).environment- The environment-variable value (injectable for tests).
-
resolvePreferencesNode
@JvmOverloads() final static String resolvePreferencesNode(String property)
Decide which
Preferencesnode to store settings in: the PREFERENCES_NODE_PROPERTY system property first, then the PREFERENCES_NODE_ENV environment variable, else DEFAULT_PREFERENCES_NODE.Why this is overridable at all: the node is per-user and machine-wide, and
PathsConfig.homeDirectoryre-reads it on every access while writing back what it resolved. With a single hard-coded node, any SPC process could relocate any other running process's home directory — a test suite moved a live grinder daemon's home into its own scratch directory and then deleted it, and equally, running the suites moved the developer's own GUI home. Giving each host its own node makes that impossible.A blank override falls back to the default rather than being honoured:
userRoot().node("")is the root node, shared with every other Java application on the account.- Parameters:
property- The system-property value (injectable for tests).
-
resolvePreferencesNode
@JvmOverloads() final static String resolvePreferencesNode()
Decide which
Preferencesnode to store settings in: the PREFERENCES_NODE_PROPERTY system property first, then the PREFERENCES_NODE_ENV environment variable, else DEFAULT_PREFERENCES_NODE.Why this is overridable at all: the node is per-user and machine-wide, and
PathsConfig.homeDirectoryre-reads it on every access while writing back what it resolved. With a single hard-coded node, any SPC process could relocate any other running process's home directory — a test suite moved a live grinder daemon's home into its own scratch directory and then deleted it, and equally, running the suites moved the developer's own GUI home. Giving each host its own node makes that impossible.A blank override falls back to the default rather than being honoured:
userRoot().node("")is the root node, shared with every other Java application on the account.
-
-
-
-