Package org.cdlib.mrt.core
Class Manifest
java.lang.Object
org.cdlib.mrt.core.Manifest
- All Implemented Interfaces:
Enumeration
Generalized line based processor where each line is some
functional unit.
Routine supports the reading and writing of manifest files
- Author:
- David Loy
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BufferedReader
protected boolean
protected String
protected LoggerInf
protected OutputStreamWriter
protected static final String
protected static final String
protected static final String
protected String
protected String
protected ManifestRowInf
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close output streamstatic Manifest
getManifest
(LoggerInf logger, String profile, ManifestRowAbs.ManifestType rowType) Manifest Factorystatic Manifest
getManifest
(LoggerInf logger, ManifestRowAbs.ManifestType rowType) Manifest FactoryEnumeration handlinggetRows
(InputStream inputStream) Enumeration handlingboolean
More manifest lines to be processedstatic void
Main methodReturn manifest row handling objectvoid
openOutput
(File outputManifestFile) Output file to write new manifestvoid
openOutput
(OutputStream outputStream) Use output stream for writing out manifestprotected void
Set manifest file as saved buffered readerprotected void
setInputStream
(InputStream inStream) Convert input stream to buffered readerprotected static void
protected static void
void
Write this line to outputvoid
write
(ManifestRowInf row) Write a line to output manifestvoid
writeEOF()
void
void
writeLines
(String[] lines)
-
Field Details
-
NAME
- See Also:
-
MESSAGE
- See Also:
-
MANIFESTEOF
- See Also:
-
prefix
-
rowFactory
-
br
-
m_ow
-
logger
-
line
-
prevLine
-
eof
protected boolean eof
-
-
Constructor Details
-
Manifest
Constructor- Parameters:
logger
- process loggerrowFactory
- row handling object- Throws:
TException
- process exception
-
-
Method Details
-
getManifest
public static Manifest getManifest(LoggerInf logger, ManifestRowAbs.ManifestType rowType) throws TException Manifest Factory- Parameters:
logger
- process loggerrowType
- row handler- Returns:
- Manifest object using specific row handler
- Throws:
TException
-
getManifest
public static Manifest getManifest(LoggerInf logger, String profile, ManifestRowAbs.ManifestType rowType) throws TException Manifest Factory- Parameters:
logger
- process loggerrowType
- row handler- Returns:
- Manifest object using specific row handler
- Throws:
TException
-
getRows
Enumeration handling- Parameters:
inputManifestFile
- line based manifest file- Returns:
- Enumeration object
- Throws:
TException
-
getRows
Enumeration handling- Parameters:
inputStream
- input stream to line based manifest file- Returns:
- Enumeration object
- Throws:
TException
-
hasMoreElements
public boolean hasMoreElements()More manifest lines to be processed- Specified by:
hasMoreElements
in interfaceEnumeration
- Returns:
- true=more lines to process, false=no more lines to process
-
nextElement
Return manifest row handling object- Specified by:
nextElement
in interfaceEnumeration
- Returns:
- row handling object
-
setFile
Set manifest file as saved buffered reader- Parameters:
manifestFile
- manifest file used for manifest processing- Throws:
TException
- process exception
-
setInputStream
Convert input stream to buffered reader- Parameters:
inStream
- input stream for manifest processing- Throws:
TException
-
openOutput
Output file to write new manifest- Parameters:
outputManifestFile
- write to this file- Throws:
TException
- process exception
-
openOutput
Use output stream for writing out manifest- Parameters:
outputStream
- output manifest stream- Throws:
TException
- process exception
-
write
Write a line to output manifest- Parameters:
row
- row handler for formatting line for output- Throws:
TException
- process exception
-
write
Write this line to output- Parameters:
localLine
- formatted line to write to manifest- Throws:
TException
-
writeHeaders
- Throws:
TException
-
writeEOF
- Throws:
TException
-
writeLines
- Throws:
TException
-
closeOutput
public void closeOutput()close output stream -
main
Main method -
testInput
- Throws:
Exception
-
testCopy
- Throws:
Exception
-