Class LargeFileSubstitutionHandler
- java.lang.Object
-
- com.sun.enterprise.admin.servermgmt.stringsubs.impl.FileSubstitutionHandler
-
- com.sun.enterprise.admin.servermgmt.stringsubs.impl.LargeFileSubstitutionHandler
-
- All Implemented Interfaces:
Substitutable
public class LargeFileSubstitutionHandler extends FileSubstitutionHandler
CreatesReaderandWriterfor the String substitution file. Implementation is useful for large files which cann't be read entirely in a memory or need a substantial amount of memory.To perform substitution it take helps of temporary file to write output, after substitution, temporary file renamed to input file.
-
-
Field Summary
-
Fields inherited from class com.sun.enterprise.admin.servermgmt.stringsubs.impl.FileSubstitutionHandler
_inputFile, _logger, _reader, _strings, _writer
-
-
Constructor Summary
Constructors Constructor Description LargeFileSubstitutionHandler(File file)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfinish()Called at the completion of the substitution process to perform post operation.ReadergetReader()Gets the character stream from the input.WritergetWriter()Gets theWriterobject to write the character stream in to the output.-
Methods inherited from class com.sun.enterprise.admin.servermgmt.stringsubs.impl.FileSubstitutionHandler
getName
-
-
-
-
Constructor Detail
-
LargeFileSubstitutionHandler
public LargeFileSubstitutionHandler(File file) throws FileNotFoundException
- Throws:
FileNotFoundException
-
-
Method Detail
-
getReader
public Reader getReader()
Description copied from interface:SubstitutableGets the character stream from the input.Implementation note: It is a good idea for the input stream to be buffered.
- Returns:
- A Reader.
-
getWriter
public Writer getWriter()
Description copied from interface:SubstitutableGets theWriterobject to write the character stream in to the output.Implementation note: It is a good idea for the output stream to be buffered.
- Returns:
- A Writer.
-
finish
public void finish()
Description copied from interface:SubstitutableCalled at the completion of the substitution process to perform post operation. For e.g closing of reader/writer, cleaning of the temporary data... etc.- Specified by:
finishin interfaceSubstitutable- Overrides:
finishin classFileSubstitutionHandler
-
-