Interface DbFile

All Known Subinterfaces:
DbImage
All Known Implementing Classes:
DbFileImpl, DbImageImpl

public interface DbFile
An opaque array of bytes, intended to represent the contents of a file.
  • Method Details

    • getName

      String getName()
      Gets the file name.
      Returns:
      file name.
    • getType

      String getType()
      Gets the file type.
      Returns:
      file type.
    • getBytes

      byte[] getBytes()
      Gets the file content as a byte array.
      Returns:
      file content as a byte array.
    • write

      void write(String file) throws IOException
      Writes the file out.
      Parameters:
      file - output file name
      Throws:
      IOException - problem writing out the file.
    • newInstance

      static DbFile newInstance()
      Creates an empty file.
    • newInstance

      static DbFile newInstance(byte[] bytes)
      Creates a file from file bytes.
      Parameters:
      bytes - file bytes
      Throws:
      NullPointerException - if bytes is null.
    • newInstance

      static DbFile newInstance(String file)
      Creates a file from a file on the filesystem.
      Parameters:
      file - file location
      Throws:
      NullPointerException - file is null.
    • newInstance

      static DbFile newInstance(File file)
      Creates a file from a file on the filesystem.
      Parameters:
      file - file location
      Throws:
      NullPointerException - file is null.