Class UpdateBuilder
java.lang.Object
io.github.projectunified.mcserverupdater.UpdateBuilder
Where to create the update process
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
static interface
-
Method Summary
Modifier and TypeMethodDescriptioncheckOnly
(boolean checkOnly) Set if the update process should only check the checksumGet the checksum consumerchecksumConsumer
(UpdateBuilder.ChecksumConsumer checksumConsumer) Set the checksum consumerchecksumFile
(File checksumFile) Set the checksum filechecksumFile
(String checksumFile) Set the checksum fileGet the checksum supplierchecksumSupplier
(UpdateBuilder.ChecksumSupplier checksumSupplier) Set the checksum suppliervoid
Debug a messageGet the debug consumerdebugConsumer
(DebugConsumer debugConsumer) Set the debug consumerexecute()
Execute the update processExecute the update processGet the names of available updatersoutputFile
(File outputFile) Set the output fileoutputFile
(String outputFile) Set the output filestatic void
registerUpdater
(Function<VersionQuery, Updater> updater, String... names) Register a updaterstatic UpdateBuilder
updateProject
(String project) Create the update processGet the user agentSet the user agent for the update processSet the versionGet the working directoryworkingDirectory
(boolean create) Get the working directoryworkingDirectory
(File workingDirectory) Set the working directoryworkingDirectory
(String workingDirectory) Set the working directory
-
Method Details
-
registerUpdater
Register a updater- Parameters:
updater
- the updaternames
- the names
-
getUpdaterNames
Get the names of available updaters- Returns:
- the names
-
updateProject
Create the update process- Parameters:
project
- the project- Returns:
- the update process
-
version
Set the version- Parameters:
version
- the version- Returns:
- the update process
-
outputFile
Set the output file- Parameters:
outputFile
- the output file- Returns:
- the update process
-
outputFile
Set the output file- Parameters:
outputFile
- the output file- Returns:
- the update process
-
workingDirectory
Set the working directory- Parameters:
workingDirectory
- the working directory- Returns:
- the update process
-
workingDirectory
Set the working directory- Parameters:
workingDirectory
- the working directory- Returns:
- the update process
-
checksumSupplier
Set the checksum supplier- Parameters:
checksumSupplier
- the checksum supplier- Returns:
- the update process
-
checksumConsumer
Set the checksum consumer- Parameters:
checksumConsumer
- the checksum consumer- Returns:
- the update process
-
debugConsumer
Set the debug consumer- Parameters:
debugConsumer
- the debug consumer- Returns:
- the update process
-
checksumFile
Set the checksum file- Parameters:
checksumFile
- the checksum file- Returns:
- the update process
-
checksumFile
Set the checksum file- Parameters:
checksumFile
- the checksum file- Returns:
- the update process
-
checkOnly
Set if the update process should only check the checksum- Parameters:
checkOnly
- the check only- Returns:
- the update process
-
userAgent
Set the user agent for the update process- Parameters:
userAgent
- the user agent string- Returns:
- the update process
-
checksumConsumer
Get the checksum consumer- Returns:
- the checksum consumer
-
checksumSupplier
Get the checksum supplier- Returns:
- the checksum supplier
-
workingDirectory
Get the working directory- Parameters:
create
- if the directory should be created if it doesn't exist- Returns:
- the working directory
-
workingDirectory
Get the working directory- Returns:
- the working directory
-
debugConsumer
Get the debug consumer- Returns:
- the debug consumer
-
userAgent
Get the user agent- Returns:
- the user agent string
-
debug
Debug a message- Parameters:
message
- the message
-
executeAsync
Execute the update process- Returns:
- the update status
-
execute
Execute the update process- Returns:
- the status of the process
- Throws:
ExecutionException
InterruptedException
-