Class IncendoPaster

java.lang.Object
com.intellectualsites.paster.IncendoPaster

public class IncendoPaster extends Object
  • Field Details

  • Constructor Details

    • IncendoPaster

      public IncendoPaster(String pasteApplication)
      Construct a new paster
      Parameters:
      pasteApplication - The application that is sending the paste
  • Method Details

    • debugPaste

      public static String debugPaste(@Nonnull File logFile, @Nullable String debugInfo, @Nullable File... extraFiles) throws IOException
      Automatically create a new debugpaste and upload it. Returns the URL.
      Parameters:
      logFile - the log file
      debugInfo - extra implementation-specific information
      extraFiles - extra files to be added to the paste
      Returns:
      URL of the paste
      Throws:
      IOException - if upload failed
    • debugPaste

      public static String debugPaste(@Nonnull File logFile, @Nullable String debugInfo, @Nullable List<File> extraFiles) throws IOException
      Automatically create a new debugpaste and upload it. Returns the URL.
      Parameters:
      logFile - the log file
      debugInfo - extra implementation-specific information
      extraFiles - extra files to be added to the paste
      Returns:
      URL of the paste
      Throws:
      IOException - if upload failed
    • getFiles

      public final Collection<IncendoPaster.PasteFile> getFiles()
      Get an immutable collection containing all the files that have been added to this paster
      Returns:
      Unmodifiable collection
    • addFile

      public void addFile(File file) throws IOException
      Throws:
      IOException
    • addFile

      public void addFile(File file, @Nullable String name) throws IOException
      Throws:
      IOException
    • addFile

      public void addFile(IncendoPaster.PasteFile file)
      Add a file to the paster. Bypasses "checks" and IP cleansing.
      Parameters:
      file - File to paste
    • upload

      public final String upload() throws Throwable
      Upload the paste and return the status message
      Returns:
      Status message
      Throws:
      Throwable - any and all exceptions