|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hyperic.util.file.FileWriter
public class FileWriter
A class which has the ability to write to files, deal with permissions/ownership, and rollback changes later on.
Constructor Summary | |
---|---|
FileWriter(java.io.File destFile,
byte[] data)
|
|
FileWriter(java.io.File destFile,
java.io.InputStream inStream,
long size)
|
Method Summary | |
---|---|
void |
cleanup()
|
protected static void |
copyStream(java.io.InputStream is,
java.io.OutputStream os,
long totalToCopy)
|
java.io.File |
getDestFile()
|
boolean |
hasWritten()
|
boolean |
isCreateOnly()
|
boolean |
isCreateOrOverwrite()
|
boolean |
isRewrite()
|
void |
rollback()
|
void |
setCreateOnly()
|
void |
setCreateOrOverwrite()
|
void |
setRewrite()
|
void |
setVerifyMD5CheckSumOnWrite(java.lang.String expectedMD5sum)
Verify the MD5 check sum on file write. |
void |
verifyMD5CheckSum()
Verify the MD5 check sum of the written file. |
void |
write()
Write the file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileWriter(java.io.File destFile, java.io.InputStream inStream, long size)
public FileWriter(java.io.File destFile, byte[] data)
Method Detail |
---|
public void setVerifyMD5CheckSumOnWrite(java.lang.String expectedMD5sum)
expectedMD5sum
- The expected MD5 check sum.public java.io.File getDestFile()
public void setCreateOnly()
public boolean isCreateOnly()
public void setCreateOrOverwrite()
public boolean isCreateOrOverwrite()
public void setRewrite()
public boolean isRewrite()
public void rollback() throws java.io.IOException
java.io.IOException
public void cleanup()
public void write() throws java.io.IOException
java.io.IOException
- if the file write fails.public void verifyMD5CheckSum() throws java.io.IOException
java.io.IOException
- if the MD5 check sum verification fails.
java.lang.IllegalStateException
- if the file has not been written yet.public boolean hasWritten()
protected static void copyStream(java.io.InputStream is, java.io.OutputStream os, long totalToCopy) throws java.io.IOException
java.io.IOException
|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |