|
Remote Systems v6.4.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
com.ibm.etools.systems.core.resources.SystemSafeFileOutputStream
This class should be used when there's a file already in the destination and we don't want to lose its contents if a failure writing this stream happens. Basically, the new contents are written to a temporary location. If everything goes OK, it is moved to the right place. The user has the option to define the temporary location or it will be created in the default-temporary directory
Field Summary | |
---|---|
protected static String |
BACKUP_EXTENSION
|
static String |
Copyright
|
protected File |
destination
|
protected boolean |
failed
|
protected OutputStream |
output
|
protected File |
temp
|
Constructor Summary | |
---|---|
SystemSafeFileOutputStream(File file)
Constructor for SystemSafeFileOutputStream. |
|
SystemSafeFileOutputStream(String destinationName)
Constructor for SystemSafeFileOutputStream. |
|
SystemSafeFileOutputStream(String destinationPath,
String tempPath)
Constructor for SystemSafeFileOutputStream. |
Method Summary | |
---|---|
void |
close()
Close the stream. |
protected void |
commit()
Commit the temporary file to the destination. |
protected void |
copy(File sourceFile,
File destinationFile)
Copy contents of one file to another. |
protected void |
createTempFile(String tempPath)
Create the temporary file at the given path. |
void |
flush()
Flush the stream. |
String |
getTempFilePath()
Get the temporary file path. |
protected void |
transferData(InputStream source,
OutputStream destination)
Transfers data from one stream to another. |
void |
write(int b)
Write an integer. |
Methods inherited from class java.io.OutputStream |
---|
write, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String Copyright
protected File destination
protected File temp
protected OutputStream output
protected boolean failed
protected static final String BACKUP_EXTENSION
Constructor Detail |
public SystemSafeFileOutputStream(File file) throws IOException
public SystemSafeFileOutputStream(String destinationName) throws IOException
public SystemSafeFileOutputStream(String destinationPath, String tempPath) throws IOException
Method Detail |
public void close() throws IOException
IOException
protected void commit() throws IOException
IOException
protected void copy(File sourceFile, File destinationFile) throws IOException
IOException
protected void createTempFile(String tempPath) throws IOException
IOException
public void flush() throws IOException
IOException
public String getTempFilePath()
protected void transferData(InputStream source, OutputStream destination) throws IOException
source
- streamdestination
- stream
IOException
public void write(int b) throws IOException
IOException
|
Remote Systems v6.4.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |