Class Content

java.lang.Object
com.cloudbees.jenkins.support.api.Content
Direct Known Subclasses:
FilePathContent, GenerateOnDemandContent, MetricsContent, PrefilteredContent, TruncatedContent, UnfilteredFileContent, UnfilteredStringContent

public abstract class Content extends Object
Represents some content in a support bundle.
Author:
Stephen Connolly
  • Constructor Details

    • Content

      protected Content(String name)
      Create a Content with this name. The name is not filtered so this constructor should be used exclusively when the name is not prone to have sensitive information. If the name of this content is dynamically generated and prone to have sensitive information, use the Content(String, String...) constructor.
      Parameters:
      name - name of the content.
    • Content

      protected Content(String name, String... filterableParameters)
      Set a name to this content with some filterable parts. The name could have elements with the form {0}, {1} that will be filtered properly using the filterableParameters. Example: Creating a content with {code}new Content("nodes/{0}/file-descriptors.txt", "node") will filter the {0} part of the name with all the declared ContentFilter. This new constructor avoid having incorrectly filtered elements in the support bundle. For example, when having a job called nodes. The nodes element in the file name of a file in the bundle shouldn't be filtered. The name is rendered using the MessageFormat.format(String, Object...) method after the filter.
      Parameters:
      name - name of the content
      filterableParameters - strings to be filtered in the name
  • Method Details

    • getName

      public String getName()
    • getFilterableParameters

      @CheckForNull public String[] getFilterableParameters()
    • writeTo

      public abstract void writeTo(OutputStream os) throws IOException
      Throws:
      IOException
    • getTime

      public long getTime() throws IOException
      Throws:
      IOException
    • shouldBeFiltered

      public boolean shouldBeFiltered()
      Indicates if this Content should be filtered when anonymization is enabled. When true, the contents written via writeTo(OutputStream) may be filtered by a ContentFilter. When false, the contents are written without any filtering applied.
      Since:
      TODO