public class DataReplacementSource extends Object implements DataSource
A file-based source which replaces the content of the source by the replacements.
Constructor and Description |
---|
DataReplacementSource(File file,
Charset encoding,
Replacements replacements,
Context context)
Creates a source.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
InputStream |
getInputStream() |
long |
getLength() |
String |
getName() |
boolean |
isResettable() |
void |
reset() |
public DataReplacementSource(File file, Charset encoding, Replacements replacements, Context context)
Creates a source.
The context will be used when the content is processed. Potential warnings will be available afterwards.
file
- The file.encoding
- The encoding of the file.replacements
- The replacements.context
- The context.IllegalArgumentException
- If any of the parameters are null
.public String getName()
getName
in interface DataSource
public long getLength()
getLength
in interface DataSource
public boolean isResettable()
isResettable
in interface DataSource
public void reset() throws IOException
reset
in interface DataSource
IOException
public InputStream getInputStream() throws IOException
getInputStream
in interface DataSource
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2015–2019. All rights reserved.