Class Manager

java.lang.Object
io.github.shayf0x.spigotwarden.Manager

public class Manager extends Object
  • Constructor Details

  • Method Details

    • createIfNotExistBuildOutput

      public boolean createIfNotExistBuildOutput()
      If Output directory doesn't exist, this method create dir
      Returns:
      [boolean] if dir has been created
    • testSpecialSource

      public String testSpecialSource()
      If SpecialSource.jar doesn't in plugin folder, this method install his at the latest version
      Returns:
      [String] SpecialSource version installed
    • testBuildTools

      public boolean testBuildTools(String version)
      That method test if all files generated by BuildTools and necessary for SpecialSource are present
      Parameters:
      version - [String] (e.g: 1.19-R0.1-SNAPSHOT).
      Returns:
      [boolean] if all BuilderTools files are present
      BuildTools files:
      -REMAPPED_MOJANG
      -MAPS_MOJANG
      -REMAPPED_OBF
      -MAPS_SPIGOT
    • install

      public void install(URL url, Path root)
      That method install file from internet to path
      Parameters:
      url - [URL] - Internet Url of file want to download e.g: "https://repo.maven.apache.org/maven2/net/md-5/SpecialSource/1.11.0/SpecialSource-1.11.0-shaded.jar"
      root - [Path] - Path of install output
    • newUrl

      public URL newUrl(String str)
      this method allows easily to generate URL with a String without worrying about the exception
      Parameters:
      str - [String] - path
      Returns:
      [URL] Url generated
    • resolve

      public URL resolve(URL url, String... str)
    • cmdBuildTools

      public void cmdBuildTools(String version)
      this method run BuildTools command to generate all BuildTools' files
      Parameters:
      version - [String] - version of spigot (e.g: 1.19-R0.1-SNAPSHOT).
    • runCommand

      public void runCommand(String[] content, Path root)
      run Command like cmd.exe commands
      Parameters:
      content - [String[]] content of command in the format of an array of Strings
      root - [Path] directory where command will be executed