Class MaskPasswordsOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- hudson.console.LineTransformationOutputStream
-
- com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsOutputStream
-
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
public class MaskPasswordsOutputStream extends LineTransformationOutputStream
Custom output stream which masks a predefined set of passwords.- Author:
- Romain Seguy (http://openromain.blogspot.com)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class hudson.console.LineTransformationOutputStream
LineTransformationOutputStream.Delegating
-
-
Constructor Summary
Constructors Constructor Description MaskPasswordsOutputStream(OutputStream logger, Collection<String> passwords)
MaskPasswordsOutputStream(OutputStream logger, Collection<String> passwords, Collection<String> regexes)
MaskPasswordsOutputStream(OutputStream logger, Collection<String> passwords, Collection<String> regexes, String runName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
protected void
eol(byte[] bytes, int len)
void
flush()
-
Methods inherited from class hudson.console.LineTransformationOutputStream
forceEol, trimEOL, write, write
-
Methods inherited from class java.io.OutputStream
nullOutputStream, write
-
-
-
-
Constructor Detail
-
MaskPasswordsOutputStream
public MaskPasswordsOutputStream(OutputStream logger, @CheckForNull Collection<String> passwords, @CheckForNull Collection<String> regexes, String runName)
- Parameters:
logger
- The output stream to which thisMaskPasswordsOutputStream
will write topasswords
- A collection ofString
s to be maskedregexes
- A collection of Regular ExpressionString
s to be maskedrunName
- A string representation of the Run/Build the output stream logger is associated with. Used for logging purposes.
-
MaskPasswordsOutputStream
public MaskPasswordsOutputStream(OutputStream logger, @CheckForNull Collection<String> passwords)
- Parameters:
logger
- The output stream to which thisMaskPasswordsOutputStream
will write topasswords
- A collection ofString
s to be masked
-
MaskPasswordsOutputStream
public MaskPasswordsOutputStream(OutputStream logger, @CheckForNull Collection<String> passwords, @CheckForNull Collection<String> regexes)
-
-
Method Detail
-
eol
protected void eol(byte[] bytes, int len) throws IOException
- Specified by:
eol
in classLineTransformationOutputStream
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classLineTransformationOutputStream
- Throws:
IOException
- on error
-
flush
public void flush() throws IOException
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
- on error
-
-