Class BlobImpl

    • Field Detail

      • fileName

        public java.lang.String fileName
      • i_ext

        public java.lang.String i_ext
      • i_length

        public int i_length
    • Constructor Detail

      • BlobImpl

        public BlobImpl()
    • Method Detail

      • adjustReadDepth

        public int adjustReadDepth​(int depth)
        Parameters:
        depth -
      • getClientInputStream

        public java.io.FileInputStream getClientInputStream()
                                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getClientOutputStream

        public java.io.FileOutputStream getClientOutputStream()
                                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getFileName

        public java.lang.String getFileName()
        Description copied from interface: Blob
        returns the name of the file the blob was stored to.

        The method may return null, if the file was never stored.
        Specified by:
        getFileName in interface Blob
        Returns:
        String the name of the file.
      • getLength

        public int getLength()
      • getStatus

        public double getStatus()
        Description copied from interface: Blob
        returns the status after the last read- or write-operation.

        The status value returned may be any of the following:
        Status.UNUSED no data was ever stored to the Blob field.
        Status.AVAILABLE available data was previously stored to the Blob field.
        Status.QUEUED an operation was triggered and is waiting for it's turn in the Blob queue.
        Status.COMPLETED the last operation on this field was completed successfully.
        Status.PROCESSING for internal use only.
        Status.ERROR the last operation failed.
        or a double between 0 and 1 that signifies the current completion percentage of the currently running operation.

        the five Status constants defined in this interface or a double between 0 and 1 that signifies the completion of the currently running operation.

        Specified by:
        getStatus in interface Blob
        Returns:
        status - the current status
        See Also:
        constants
      • getStatusFrom

        public void getStatusFrom​(BlobStatus from)
      • readFrom

        public void readFrom​(java.io.File file)
                      throws java.io.IOException
        Description copied from interface: Blob
        reads a file into the db4o system and stores it as a blob.

        In Client/Server mode db4o will open an additional socket and process writing data in an additional thread.

        Specified by:
        readFrom in interface Blob
        Parameters:
        file - the file the blob is to be read from.
        Throws:
        java.io.IOException - in case of errors
      • readLocal

        public void readLocal​(java.io.File file)
                       throws java.io.IOException
        Description copied from interface: Blob
        reads a file into the db4o system and stores it as a blob.

        db4o will use the local file system in Client/Server mode also.

        Specified by:
        readLocal in interface Blob
        Parameters:
        file - the file the blob is to be read from.
        Throws:
        java.io.IOException - in case of errors
      • serverFile

        public java.io.File serverFile​(java.lang.String promptName,
                                       boolean writeToServer)
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • setStatus

        public void setStatus​(double status)
      • writeLocal

        public void writeLocal​(java.io.File file)
                        throws java.io.IOException
        Description copied from interface: Blob
        writes stored blob data to a file.

        db4o will use the local file system in Client/Server mode also.

        Specified by:
        writeLocal in interface Blob
        Parameters:
        file - the file the blob is to be written to.
        Throws:
        java.io.IOException - in case of errors and in case no blob data was stored
      • writeTo

        public void writeTo​(java.io.File file)
                     throws java.io.IOException
        Description copied from interface: Blob
        writes stored blob data to a file.

        In Client/Server mode db4o will open an additional socket and process writing data in an additional thread.

        Specified by:
        writeTo in interface Blob
        Parameters:
        file - the file the blob is to be written to.
        Throws:
        java.io.IOException - in case of errors and in case no blob data was stored
      • deleteFile

        public void deleteFile()
                        throws java.io.IOException
        Description copied from interface: Blob
        Deletes the current file stored in this BLOB.
        Specified by:
        deleteFile in interface Blob
        Throws:
        java.io.IOException - in case of errors and in case no data was stored