|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ptc.windchill.structconf.DerivedFile
Abstraction to represent files that the propagator may need to write after a propagation. Only package implementors need to use this API.
Constructor Summary | |
DerivedFile()
|
Method Summary | |
abstract File |
getTargetFile()
|
(package private) long |
write()
Write the contents of the file to the file returned in getTargetFile()
and return the CRC32 crc value of the contents of the file. |
abstract void |
write(BufferedOutputStream bos)
Write the contents of the derived file returned in getTargetFile()
to the BufferedOutputStream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DerivedFile()
Method Detail |
public abstract File getTargetFile()
final long write() throws IOException
getTargetFile()
and return the CRC32 crc value of the contents of the file. This CRC value will be used
to compare the new file to the backup of the file and if they are identical the
redundant backup will be used. Thus it is important that repeated writing
of the file with the same logical contents produce the same CRC each time. So avoid
putting things like generation timestamp in your derived files.
IOException
public abstract void write(BufferedOutputStream bos) throws IOException
getTargetFile()
to the BufferedOutputStream. If character set conversion is desired, then use
java.util.OutputStreamWriter to produce an appropriate writer.
Subclasses needs only worry about flushing the stream if they wrap the stream with a buffering stream of their own. Otherwise this base class manages flushing and closing the stream.
Note subclasses should not supposed directly open and close the file streams themselfs. The sturcutured configuration manager does this to facility proper backup and recovery in the event of a file writing failure.
IOException
- subclasses may throw an IOException to signal problems while writing the DerivedFile contents.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |