Package hec.util

Class SimpleFile

java.lang.Object
java.io.File
hec.util.SimpleFile
All Implemented Interfaces:
hec.io.HecFile, Serializable, Comparable<File>

public class SimpleFile extends File implements hec.io.HecFile
See Also:
  • Field Details

    • TMP_EXTENSION

      protected static final String TMP_EXTENSION
      extension used for temp files
      See Also:
    • BAK_EXTENSION

      protected static final String BAK_EXTENSION
      extension used for backup files
      See Also:
    • _staticWriteToTmpDefault

      protected static boolean _staticWriteToTmpDefault
      Default value for write to a tmp file.
    • _writeToTmp

      protected boolean _writeToTmp
      whether to write to a tmp file instead of the real file during writes
  • Constructor Details

    • SimpleFile

      public SimpleFile(File parent, String child)
      Parameters:
      parent -
      child -
    • SimpleFile

      public SimpleFile(String parent, String child)
    • SimpleFile

      public SimpleFile(String pathname)
  • Method Details

    • setWriteToTmpFile

      public static void setWriteToTmpFile(boolean writeToTmp)
    • appendByteArray

      public boolean appendByteArray(byte[] byteArray)
      Specified by:
      appendByteArray in interface hec.io.HecFile
      Parameters:
      byteArray -
      Returns:
      See Also:
      • HecFile.appendByteArray(byte[])
    • copyFile

      protected void copyFile(File src, File dest) throws IOException
      copies src to dest - does no checking of the files.
      Throws:
      IOException
    • close

      public void close() throws IOException
      Specified by:
      close in interface hec.io.HecFile
      Throws:
      IOException
      See Also:
      • HecFile.close()
    • getAppendedBufferedWriter

      public BufferedWriter getAppendedBufferedWriter()
      Specified by:
      getAppendedBufferedWriter in interface hec.io.HecFile
      Returns:
      See Also:
      • HecFile.getAppendedBufferedWriter()
    • getAppendedDataOutputStream

      public DataOutputStream getAppendedDataOutputStream()
      Specified by:
      getAppendedDataOutputStream in interface hec.io.HecFile
      Returns:
      See Also:
      • HecFile.getAppendedDataOutputStream()
    • getBufferedReader

      public BufferedReader getBufferedReader()
      Specified by:
      getBufferedReader in interface hec.io.HecFile
      Returns:
      See Also:
      • HecFile.getBufferedReader()
    • getBufferedWriter

      public BufferedWriter getBufferedWriter()
      Specified by:
      getBufferedWriter in interface hec.io.HecFile
      Returns:
      See Also:
      • HecFile.getBufferedWriter()
    • getByteArray

      public byte[] getByteArray()
      Specified by:
      getByteArray in interface hec.io.HecFile
      Returns:
      See Also:
      • HecFile.getByteArray()
    • getByteArray

      public byte[] getByteArray(boolean compress)
      Return a byte[] containing the data from the File.
      Parameters:
      compress - flag indicating whether to compress the byte[] being returned
    • getByteArray

      public byte[] getByteArray(long off, int len)
      Specified by:
      getByteArray in interface hec.io.HecFile
      Parameters:
      off -
      len -
      Returns:
      See Also:
      • HecFile.getByteArray(long, int)
    • getByteArrayInputStream

      public ByteArrayInputStream getByteArrayInputStream()
      Specified by:
      getByteArrayInputStream in interface hec.io.HecFile
      Returns:
      See Also:
      • HecFile.getByteArrayInputStream()
    • getByteArrayOutputStream

      public ByteArrayOutputStream getByteArrayOutputStream()
      Specified by:
      getByteArrayOutputStream in interface hec.io.HecFile
      Returns:
      See Also:
      • HecFile.getByteArrayOutputStream()
    • getCheckSum

      public long getCheckSum()
      Specified by:
      getCheckSum in interface hec.io.HecFile
      Returns:
      See Also:
      • HecFile.getCheckSum()
    • getDataInputStream

      public DataInputStream getDataInputStream()
      Specified by:
      getDataInputStream in interface hec.io.HecFile
      Returns:
      See Also:
      • HecFile.getDataInputStream()
    • getDataOutputStream

      public DataOutputStream getDataOutputStream()
      Specified by:
      getDataOutputStream in interface hec.io.HecFile
      Returns:
      See Also:
      • HecFile.getDataOutputStream()
    • getEndianInputStream

      public hec.io.EndianInputStream getEndianInputStream()
      Specified by:
      getEndianInputStream in interface hec.io.HecFile
      Returns:
      See Also:
      • HecFile.getEndianInputStream()
    • getEndianOutputStream

      public hec.io.EndianOutputStream getEndianOutputStream()
      Specified by:
      getEndianOutputStream in interface hec.io.HecFile
      Returns:
      See Also:
      • HecFile.getEndianOutputStream()
    • getObjectInputStream

      public ObjectInputStream getObjectInputStream()
      Specified by:
      getObjectInputStream in interface hec.io.HecFile
      Returns:
      See Also:
      • HecFile.getObjectInputStream()
    • getObjectOutputStream

      public ObjectOutputStream getObjectOutputStream() throws IOException
      Specified by:
      getObjectOutputStream in interface hec.io.HecFile
      Returns:
      Throws:
      IOException
      See Also:
      • HecFile.getObjectOutputStream()
    • getUsingCompression

      public boolean getUsingCompression()
      Specified by:
      getUsingCompression in interface hec.io.HecFile
      Returns:
      See Also:
      • HecFile.getUsingCompression()
    • isNetworked

      public boolean isNetworked()
      Specified by:
      isNetworked in interface hec.io.HecFile
      Returns:
      See Also:
      • HecFile.isNetworked()
    • lockFile

      public boolean lockFile(hec.io.FileLock fLock)
      Specified by:
      lockFile in interface hec.io.HecFile
      Parameters:
      fLock -
      Returns:
      See Also:
      • HecFile.lockFile(hec.io.FileLock)
    • notify

      public void notify(String message)
      Specified by:
      notify in interface hec.io.HecFile
      Parameters:
      message -
      See Also:
      • HecFile.notify(java.lang.String)
    • save

      public boolean save()
      Specified by:
      save in interface hec.io.HecFile
      Returns:
      See Also:
      • HecFile.save()
    • setByteArray

      public boolean setByteArray(byte[] byteArray)
      Specified by:
      setByteArray in interface hec.io.HecFile
      Parameters:
      byteArray -
      Returns:
      See Also:
      • HecFile.setByteArray(byte[])
    • setUseCompression

      public void setUseCompression(boolean compress)
      Specified by:
      setUseCompression in interface hec.io.HecFile
      Parameters:
      compress -
      See Also:
      • HecFile.setUseCompression(boolean)
    • unlockFile

      public boolean unlockFile(hec.io.FileLock fLock)
      Specified by:
      unlockFile in interface hec.io.HecFile
      Parameters:
      fLock -
      Returns:
      See Also:
      • HecFile.unlockFile(hec.io.FileLock)
    • writeBytes

      public void writeBytes(long bytePos, byte[] bytes)
      Specified by:
      writeBytes in interface hec.io.HecFile
    • writeFloat

      public void writeFloat(long bytePos, float f)
      Specified by:
      writeFloat in interface hec.io.HecFile
      Parameters:
      bytePos -
      f -
      See Also:
      • HecFile.writeFloat(long, float)