public class HecFileImpl extends java.io.File implements HecFile, java.io.Serializable
Construct a HecFileImpl using a FilePath Object or with a RmiFileImpl RemoteWrapper.
Use getBufferedReader for UNICODE Reading of a HecFile.
Use getBufferedWriter for UNICODE Writing of a HecFile.
NOTE - the writing must be followed by a save() to send the byte[] to the RmiFileImpl.
RmiFileImpl,
FilePath,
Serialized Form| Constructor and Description |
|---|
HecFileImpl(FilePath filePath)
The Constructor with a FilePath.
|
HecFileImpl(hec.server.RemoteWrapper RmiFileImpl)
The Constructor with a RmiFileImpl in a RemoteWrapper.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFileToCacheList() |
boolean |
appendByteArray(byte[] byteArray)
Appends the byte[] to the end of the file.
|
boolean |
canRead()
Tests whether the application can read the file denoted by this HecFile.
|
boolean |
canWrite()
Tests whether the application can modify the file denoted by this HecFile.
|
void |
close()
pass on the close to the RmiFile
|
boolean |
exists()
Tests whether the file denoted by this HecFile exists.
|
java.lang.String |
getAbsolutePath() |
java.io.BufferedWriter |
getAppendedBufferedWriter()
Returns an appending BufferedWriter for the HecFile.
|
java.io.DataOutputStream |
getAppendedDataOutputStream()
Returns an appending DataOutputStream for the HecFile.
|
java.io.BufferedReader |
getBufferedReader()
Returns a BufferedReader for the reading in Data.
|
java.io.BufferedWriter |
getBufferedWriter()
Returns a BufferedWriter for the HecFile.
|
byte[] |
getByteArray()
Return the byte[] representing the HecFile's data.
|
byte[] |
getByteArray(long off,
int len)
get the byte[] from the file starting at off for len.
|
java.io.ByteArrayInputStream |
getByteArrayInputStream()
Returns a Network Only ByteArrayInputStream for the HecFile.
|
java.io.ByteArrayOutputStream |
getByteArrayOutputStream()
Returns a Network Only ByteArrayOutputStream for the HecFile.
|
java.lang.String |
getCachedFilename()
get the cached filename for this file
TODO remove reliance on ClientApp.
|
long |
getCheckSum()
get the checkSum value for the file
|
java.io.DataInputStream |
getDataInputStream()
Returns a DataInputStream for the HecFile.
|
java.io.DataOutputStream |
getDataOutputStream()
Returns a DataOutputStream for the HecFile.
|
EndianInputStream |
getEndianInputStream()
Returns an EndianInputStream for the HecFile.
|
EndianOutputStream |
getEndianOutputStream()
Returns an EndianOutputStream for the HecFile.
|
hec.server.RemoteWrapper |
getFileWrapper()
Returns the RemoteWrapper containing the RmiFileImpl.
|
java.lang.String |
getLineSeparator()
return the line separator string for this file
|
java.lang.String |
getName()
Return a string representing this HecFile's name.
Locally this will return java.io.File.getName(). Remotely this will return hec.server.RmiFileImpl.getFileName(). |
java.io.ObjectInputStream |
getObjectInputStream()
Returns a ObjectInputStream for the HecFile.
|
java.io.ObjectOutputStream |
getObjectOutputStream()
Returns a ObjectOutputStream for the HecFile.
|
java.lang.String |
getPath()
Returns the path of this HecFile.
|
boolean |
getUsingCompression()
return whether this
HecFile is using Compression to read/write
data to the RmiFile |
boolean |
isDirectory()
Return a boolean indicating whether or not this HecFile is a directory.
|
boolean |
isFile()
Tests whether the file denoted by this HecFile is a normal file.
|
boolean |
isFileCached()
return the length of the cached file.
|
boolean |
isNetworked()
Get whether this HecFile represents a networked or local file.
|
long |
lastModified()
Returns the time that the file denoted by this HecFile was last modified.
|
long |
length()
Returns the length of the file denoted by this HecFile.
|
boolean |
lockFile(FileLock fLock)
Lock this file with fLock.
|
boolean |
mkdirs()
Creates the directory named by this HecFile, including any necessary but
nonexistent parent directories.
|
void |
notify(java.lang.String message)
Send message to all callback objects registered with this file.
|
java.lang.String |
readln()
This used to be the readln method..
|
void |
removeCallBack(hec.server.RemoteWrapper callBackWrap) |
void |
removeCallBack(hec.csinterface.RmiFileCallBack callBack) |
boolean |
save()
Returns a boolean if the save was successful.
This method uses the BufferedWriter from getBufferedWriter() and saves the data to the RmiFileImpl. |
boolean |
setByteArray(byte[] byteArray)
Returns a boolean indicating whether or not the byte[] was successfully set.
|
void |
setCacheLocalFile(boolean cacheIt)
cache the file locally
|
static void |
setCachingEnabled(boolean b) |
void |
setCallBack(hec.server.RemoteWrapper callBackWrap) |
boolean |
setLastModified(long time) |
void |
setUseCompression(boolean compress)
set whether this
HecFile should use compression to read/write
data to/from the RmiFile |
boolean |
shouldCacheLocalFile()
return whether to cache the file locally or not.
|
boolean |
unlockFile(FileLock fLock)
Unlock this file with fLock.
|
void |
writeBytes(long bytePos,
byte[] bytes) |
void |
writeFloat(long bytePos,
float f)
Write a float f to position bytePos in this HecFile.
|
canExecute, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, getAbsoluteFile, getCanonicalFile, getCanonicalPath, getFreeSpace, getParent, getParentFile, getTotalSpace, getUsableSpace, hashCode, isAbsolute, isHidden, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, renameTo, setExecutable, setExecutable, setReadable, setReadable, setReadOnly, setWritable, setWritable, toPath, toString, toURI, toURLpublic HecFileImpl(hec.server.RemoteWrapper RmiFileImpl)
public HecFileImpl(FilePath filePath)
public void setCallBack(hec.server.RemoteWrapper callBackWrap)
public void removeCallBack(hec.csinterface.RmiFileCallBack callBack)
public void removeCallBack(hec.server.RemoteWrapper callBackWrap)
public boolean isDirectory()
isDirectory in interface HecFileisDirectory in class java.io.Filepublic java.lang.String getName()
public hec.server.RemoteWrapper getFileWrapper()
public java.lang.String getPath()
public byte[] getByteArray()
getByteArray in interface HecFilepublic byte[] getByteArray(long off,
int len)
getByteArray in interface HecFileoff - the starting position in the filelen - the number of bytespublic boolean setByteArray(byte[] byteArray)
setByteArray in interface HecFilebyteArray - the file's new datapublic boolean appendByteArray(byte[] byteArray)
appendByteArray in interface HecFilebyteArray - the bytes to append to the end of this file.public java.io.BufferedWriter getBufferedWriter()
getBufferedWriter in interface HecFilepublic java.lang.String getLineSeparator()
public java.io.BufferedWriter getAppendedBufferedWriter()
getAppendedBufferedWriter in interface HecFilepublic java.io.DataOutputStream getDataOutputStream()
getDataOutputStream in interface HecFilepublic java.io.DataOutputStream getAppendedDataOutputStream()
getAppendedDataOutputStream in interface HecFilepublic java.io.DataInputStream getDataInputStream()
getDataInputStream in interface HecFilepublic java.io.ObjectOutputStream getObjectOutputStream()
throws java.io.IOException
getObjectOutputStream in interface HecFilejava.io.IOExceptionpublic java.io.ObjectInputStream getObjectInputStream()
getObjectInputStream in interface HecFilepublic java.io.ByteArrayOutputStream getByteArrayOutputStream()
getByteArrayOutputStream in interface HecFilepublic java.io.ByteArrayInputStream getByteArrayInputStream()
getByteArrayInputStream in interface HecFilepublic EndianInputStream getEndianInputStream()
getEndianInputStream in interface HecFilepublic EndianOutputStream getEndianOutputStream()
getEndianOutputStream in interface HecFilepublic boolean save()
public java.io.BufferedReader getBufferedReader()
getBufferedReader in interface HecFilepublic boolean shouldCacheLocalFile()
public void setCacheLocalFile(boolean cacheIt)
cacheIt - public java.lang.String readln()
public void notify(java.lang.String message)
HecFilepublic boolean canRead()
HecFilepublic boolean isFile()
HecFilepublic java.lang.String getAbsolutePath()
getAbsolutePath in class java.io.Filepublic boolean exists()
HecFilepublic boolean canWrite()
HecFilepublic boolean mkdirs()
HecFilepublic long length()
HecFilepublic long lastModified()
HecFilelastModified in interface HecFilelastModified in class java.io.Filepublic boolean setLastModified(long time)
setLastModified in class java.io.Filepublic void close()
throws java.io.IOException
public long getCheckSum()
getCheckSum in interface HecFileCRC32public boolean isNetworked()
HecFileisNetworked in interface HecFilepublic boolean lockFile(FileLock fLock)
HecFilepublic boolean unlockFile(FileLock fLock)
HecFileunlockFile in interface HecFilefLock - The type of FileLock to use to unlock this HecFile.public void setUseCompression(boolean compress)
HecFile should use compression to read/write
data to/from the RmiFilesetUseCompression in interface HecFilecompress - whether to use compression or notRmiFile.setByteArray(byte[]),
RmiFile.appendByteArray(byte[]),
RmiFile.getByteArray()public boolean getUsingCompression()
HecFile is using Compression to read/write
data to the RmiFilegetUsingCompression in interface HecFileRmiFile.setByteArray(byte[]),
RmiFile.appendByteArray(byte[]),
RmiFile.getByteArray()public void writeBytes(long bytePos,
byte[] bytes)
writeBytes in interface HecFilepublic void writeFloat(long bytePos,
float f)
HecFilewriteFloat in interface HecFilebytePos - The position in the file to write f.f - The float to write.public java.lang.String getCachedFilename()
public void addFileToCacheList()
public boolean isFileCached()
public static void setCachingEnabled(boolean b)