public class CleanupRandomAccessFile extends java.io.RandomAccessFile implements SimpleLogSupport
RandomAccessFile
which is opened in rw mode. It ensures that the output
file is deleted in case of cancellation or error.Constructor and Description |
---|
CleanupRandomAccessFile(AsyncExecutable task,
java.io.File file) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
java.io.File |
getFile() |
LogChannel |
getLogChannel() |
boolean |
hasError() |
boolean |
isLogDebug() |
boolean |
isLogVerbose() |
void |
logDebug(java.lang.String message) |
void |
logDump(java.lang.String message) |
void |
logError(java.lang.String message) |
void |
logError(java.lang.String message,
java.lang.Exception e) |
void |
logFatal(java.lang.String message,
java.lang.Exception e) |
protected void |
logFileClosed(java.io.File file) |
protected void |
logFileCreated(java.io.File file) |
protected void |
logFileDeleted(java.io.File file) |
void |
logInfo(java.lang.String message) |
void |
logVerbose(java.lang.String message) |
void |
logWarning(java.lang.String message) |
void |
setDeleteFileOnCancel(boolean isDeleteOnCancel) |
void |
setDeleteFileOnError(boolean isDeleteOnError) |
void |
setLogChannel(LogChannel logCh) |
boolean |
wasCancelled() |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
getChannel, getFD, getFilePointer, length, read, read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, seek, setLength, skipBytes, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
public CleanupRandomAccessFile(AsyncExecutable task, java.io.File file) throws java.io.FileNotFoundException
java.io.FileNotFoundException
public void setDeleteFileOnError(boolean isDeleteOnError)
public void setDeleteFileOnCancel(boolean isDeleteOnCancel)
protected void logFileCreated(java.io.File file)
protected void logFileClosed(java.io.File file)
protected void logFileDeleted(java.io.File file)
public void write(byte[] b) throws java.io.IOException
write
in interface java.io.DataOutput
write
in class java.io.RandomAccessFile
java.io.IOException
public void write(byte[] b, int off, int len) throws java.io.IOException
write
in interface java.io.DataOutput
write
in class java.io.RandomAccessFile
java.io.IOException
public void write(int b) throws java.io.IOException
write
in interface java.io.DataOutput
write
in class java.io.RandomAccessFile
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.RandomAccessFile
java.io.IOException
public java.io.File getFile()
public boolean hasError()
public boolean wasCancelled()
public LogChannel getLogChannel()
getLogChannel
in interface SimpleLogSupport
public boolean isLogDebug()
isLogDebug
in interface SimpleLogSupport
public boolean isLogVerbose()
isLogVerbose
in interface SimpleLogSupport
public void logDebug(java.lang.String message)
logDebug
in interface SimpleLogSupport
public void logDump(java.lang.String message)
logDump
in interface SimpleLogSupport
public void logError(java.lang.String message, java.lang.Exception e)
logError
in interface SimpleLogSupport
public void logError(java.lang.String message)
logError
in interface SimpleLogSupport
public void logFatal(java.lang.String message, java.lang.Exception e)
logFatal
in interface SimpleLogSupport
public void logInfo(java.lang.String message)
logInfo
in interface SimpleLogSupport
public void logVerbose(java.lang.String message)
logVerbose
in interface SimpleLogSupport
public void logWarning(java.lang.String message)
logWarning
in interface SimpleLogSupport
public void setLogChannel(LogChannel logCh)
setLogChannel
in interface SimpleLogSupport
Copyright © 2014 EsprIT-Systems. All Rights Reserved.