Class ApiWrapper
-
- All Implemented Interfaces:
public final class ApiWrapperAPI wrapper, allowing you to conveniently initialize, setup and use the different aspects of ServerPackCreator.
Griefed
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classApiWrapper.Companion
-
Field Summary
-
Method Summary
-
-
Method Detail
-
getProperties
final File getProperties()
-
getXmlJsonRegex
final Regex getXmlJsonRegex()
-
getSetupWasRun
final Boolean getSetupWasRun()
-
setSetupWasRun
final Unit setSetupWasRun(Boolean value)
-
getApiProperties
@Synchronized() final ApiProperties getApiProperties()
-
getFirstRun
final Boolean getFirstRun()
-
getObjectMapper
@Synchronized() final ObjectMapper getObjectMapper()
-
getJsonUtilities
@Synchronized() final JsonUtilities getJsonUtilities()
-
getWebUtilities
@Synchronized() final WebUtilities getWebUtilities()
-
getDocumentBuilderFactory
@Synchronized() final DocumentBuilderFactory getDocumentBuilderFactory()
-
getXmlUtilities
@Synchronized() final XmlUtilities getXmlUtilities()
-
getUtilities
@Synchronized() final Utilities getUtilities()
-
getVersionMeta
@Synchronized() final VersionMeta getVersionMeta()
-
getConfigurationHandler
@Synchronized() final ConfigurationHandler getConfigurationHandler()
-
getApiPlugins
@Synchronized() final ApiPlugins getApiPlugins()
-
getServerPackHandler
@Synchronized() final ServerPackHandler getServerPackHandler()
-
getModScanner
@Synchronized() final ModScanner getModScanner()
-
getForgeAnnotationScanner
@Synchronized() final ForgeAnnotationScanner getForgeAnnotationScanner()
-
getFabricScanner
@Synchronized() final FabricScanner getFabricScanner()
-
getQuiltScanner
@Synchronized() final QuiltScanner getQuiltScanner()
-
getTomlParser
@Synchronized() final TomlParser getTomlParser()
-
getForgeTomlScanner
final ForgeTomlScanner getForgeTomlScanner()
-
getNeoForgeTomlScanner
@Synchronized() final NeoForgeTomlScanner getNeoForgeTomlScanner()
-
setup
@Synchronized() final ApiWrapper setup(Boolean force)
Convenience method to set up ServerPackCreator.
-
stageOne
final Unit stageOne()
Stage one of starting ServerPackCreator.
Creates and prepares the environment for ServerPackCreator to run by creating required directories and copying required files from the JAR-file to the filesystem. Some of these files can and should be edited by a given user, others however, not.
Checks the read- and write-permissions of ServerPackCreators base-directory.
Copies the
README.mdfrom the JAR to the home-directory.Copies the
HELP.mdfrom the JAR to the home-directory.Copies the
CHANGELOG.mdfrom the JAR to the home-directory.Copies the
LICENSEfrom the JAR to the home-directory.Copies the fallback version-manifests to the manifests.
Creates default directories:
server_files
work
temp
work/modpacks
server-packs (depending on the users settings, this may be anywhere on the users system)
plugins
plugins/config
Example
disabled.txt-file in plugins/disabled.txt.Creates the default
server.propertiesif it doesn't exist.Creates the default
server-icon.pngif it doesn't exist.Creates the default PowerShell and Shell script templates or overwrites them if they already exist.
Determines whether this instance of ServerPackCreator was updated from a previous version.
If an update was detected, and migrations are available for any of the steps of the update, they are executed, thus ensuring users are safe to update their instances. Writes ServerPackCreator and system information to the console and logs, important for error reporting and debugging.
-
stageThree
final Unit stageThree()
Initialize ApiPlugins, de.griefed.serverpackcreator.api.modscanning.ModScanner (consisting of TomlParser, de.griefed.serverpackcreator.api.modscanning.ForgeAnnotationScanner, de.griefed.serverpackcreator.api.modscanning.FabricScanner, de.griefed.serverpackcreator.api.modscanning.ForgeTomlScanner, de.griefed.serverpackcreator.api.modscanning.QuiltScanner), ServerPackHandler.
-
checkServerFilesFile
final Boolean checkServerFilesFile(File fileToCheckFor)
Check whether the specified server-files file exists and create it if it doesn't.
- Parameters:
fileToCheckFor- The file which is to be checked for whether it exists and if it doesn't, should be created.- Returns:
trueif the file was generated.
-
overwriteServerFilesFile
final Unit overwriteServerFilesFile(File fileToOverwrite)
Overwrite the specified server-files file, even when it exists. Used to ensure files like the default script templates are always up-to-date.
- Parameters:
fileToOverwrite- The file which is to be overwritten.
-
-
-
-