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
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String[]
getFilterableParameters()
String
getName()
long
getTime()
boolean
shouldBeFiltered()
Indicates if this Content should be filtered when anonymization is enabled.abstract void
writeTo(OutputStream os)
-
-
-
Constructor Detail
-
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 theContent(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 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 Detail
-
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. Whentrue
, the contents written viawriteTo(OutputStream)
may be filtered by aContentFilter
. Whenfalse
, the contents are written without any filtering applied.- Since:
- TODO
-
-