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
CreatesReader
andWriter
for 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.
-
-
Constructor Summary
Constructors Constructor Description LargeFileSubstitutionHandler(File file)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
finish()
Called at the completion of the substitution process to perform post operation.Reader
getReader()
Gets the character stream from the input.Writer
getWriter()
Gets theWriter
object 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:Substitutable
Gets 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:Substitutable
Gets theWriter
object 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:Substitutable
Called 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:
finish
in interfaceSubstitutable
- Overrides:
finish
in classFileSubstitutionHandler
-
-