Class DebugBuilder<T extends DebugBuilder<T>>

java.lang.Object
dev.themeinerlp.plugindebug.DebugBuilder<T>

public class DebugBuilder<T extends DebugBuilder<T>> extends Object
  • Field Details

  • Constructor Details

    • DebugBuilder

      protected DebugBuilder(String uploadServer)
  • Method Details

    • addFile

      public T addFile(DebugFile file)
      Add a debug file RAW into the debug zip
    • addFile

      public T addFile(Path filePath, FileType fileType, String uiTabName)
      Add a debug file RAW into the debug zip
      Parameters:
      filePath - to collect into the zip
      fileType - to display in the frontend
      uiTabName - to display tn the frontend
    • addText

      public T addText(String text, String uiTabName) throws IOException
      Add a text as a file into the debug zip
      Parameters:
      text - to collect into the zip
      uiTabName - to display tn the frontend
      Throws:
      IOException
    • addJson

      public T addJson(String json, String uiTabName) throws IOException
      Add a json string as a file into the debug zip
      Parameters:
      json - to collect into the zip
      uiTabName - to display tn the frontend
      Throws:
      IOException
    • addYAML

      public T addYAML(String yaml, String uiTabName) throws IOException
      Add a json string as a file into the debug zip
      Parameters:
      yaml - to collect into the zip
      uiTabName - to display tn the frontend
      Throws:
      IOException
    • upload

      public DebugUploadResult upload() throws IOException
      Upload the debug to bytebin server
      Returns:
      an object with bytebin server address and upload code
      Throws:
      IOException - throws when java don't have access to temp dir
    • builder

      public static DebugBuilder<?> builder(String uploadServer)
      Creates a builder instance with the given bytebin server
      Parameters:
      uploadServer - bytebin server base url