Class Content
java.lang.Object
com.cloudbees.jenkins.support.api.Content
- Direct Known Subclasses:
FilePathContent
,GenerateOnDemandContent
,MetricsContent
,PrefilteredContent
,TruncatedContent
,UnfilteredFileContent
,UnfilteredStringContent
Represents some content in a support bundle.
- Author:
- Stephen Connolly
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionString[]
getName()
long
getTime()
boolean
Indicates if this Content should be filtered when anonymization is enabled.abstract void
writeTo
(OutputStream os)
-
Constructor Details
-
Content
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 theContent(String, String...)
constructor.- Parameters:
name
- name of the content.
-
Content
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 declaredContentFilter
. 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 theMessageFormat.format(String, Object...)
method after the filter.- Parameters:
name
- name of the contentfilterableParameters
- strings to be filtered in the name
-
-
Method Details
-
getName
-
getFilterableParameters
-
writeTo
- Throws:
IOException
-
getTime
- Throws:
IOException
-
shouldBeFiltered
public boolean shouldBeFiltered()Indicates if this Content should be filtered when anonymization is enabled. Whentrue
, the contents written viawriteTo(OutputStream)
may be filtered by aContentFilter
. Whenfalse
, the contents are written without any filtering applied.- Since:
- TODO
-