Class FileContent
- java.lang.Object
-
- com.cloudbees.jenkins.support.api.Content
-
- com.cloudbees.jenkins.support.filter.PrefilteredContent
-
- com.cloudbees.jenkins.support.api.FileContent
-
- Direct Known Subclasses:
LaunchLogsFileContent
,TemporaryFileContent
public class FileContent extends PrefilteredContent
Content that is stored as a file on disk. The content is filtered with theContentFilter
defined in the instance.- Author:
- Stephen Connolly
-
-
Field Summary
Fields Modifier and Type Field Description protected com.cloudbees.jenkins.support.api.BaseFileContent
baseFileContent
protected File
file
-
Constructor Summary
Constructors Constructor Description FileContent(String name, File file)
FileContent(String name, File file, long maxSize)
FileContent(String name, String[] filterableParameters, File file)
FileContent(String name, String[] filterableParameters, File file, long maxSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected InputStream
getInputStream()
Instantiates theInputStream
for thefile
.protected String
getSimpleValueOrRedactedPassword(String value)
long
getTime()
void
writeTo(OutputStream os)
void
writeTo(OutputStream os, ContentFilter filter)
Write the component in the bundle filtering the content-
Methods inherited from class com.cloudbees.jenkins.support.filter.PrefilteredContent
shouldBeFiltered
-
Methods inherited from class com.cloudbees.jenkins.support.api.Content
getFilterableParameters, getName
-
-
-
-
Field Detail
-
baseFileContent
protected com.cloudbees.jenkins.support.api.BaseFileContent baseFileContent
-
file
protected final File file
-
-
Method Detail
-
writeTo
public void writeTo(OutputStream os) throws IOException
- Specified by:
writeTo
in classContent
- Throws:
IOException
-
writeTo
public void writeTo(OutputStream os, ContentFilter filter) throws IOException
Description copied from class:PrefilteredContent
Write the component in the bundle filtering the content- Specified by:
writeTo
in classPrefilteredContent
- Parameters:
os
- OutputStream where write the contentfilter
- ContentFilter to apply- Throws:
IOException
- If an input or output exception occurs
-
getInputStream
protected InputStream getInputStream() throws IOException
Instantiates theInputStream
for thefile
.- Returns:
- the
InputStream
for thefile
. - Throws:
IOException
- if something goes wrong while creating the stream for reading #file.
-
-