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 DataSourcepublic long getLength()
getLength in interface DataSourcepublic boolean isResettable()
isResettable in interface DataSourcepublic void reset()
throws IOException
reset in interface DataSourceIOExceptionpublic InputStream getInputStream() throws IOException
getInputStream in interface DataSourceIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2015–2019. All rights reserved.