com.groupdocs.redaction

Class DocumentFormatInstance



  • public abstract class DocumentFormatInstance
    extends Object

    Represents any specific format of the document. Implement this class to add your own document types

    • Field Detail

      • RejectionMessage

        protected static final String RejectionMessage

        Common message for redactions, rejected by user through IRedactionCallback

        See Also:
        Constant Field Values
    • Constructor Detail

      • DocumentFormatInstance

        public DocumentFormatInstance()
    • Method Detail

      • getPassword

        public final String getPassword()

        Gets or sets password for password protected document

      • setPassword

        public final void setPassword(String value)

        Gets or sets password for password protected document

      • initialize

        public void initialize(DocumentFormatConfiguration config)

        Initializes an instance of document format connector

        Parameters:
        config - Format configuration
      • load

        public final void load(String filePath)
                        throws Exception

        Load document from a file

        Parameters:
        filePath - Path to file
        Throws:
        Exception
      • load

        public void load(InputStream input)
                  throws Exception

        Load document from a stream

        Parameters:
        input - Stream to read from
        Throws:
        Exception
      • save

        public abstract void save(OutputStream output)
                           throws Exception

        Save document to a stream

        Parameters:
        output - Target stream to save the document
        Throws:
        Exception
      • performBinaryCheck

        public boolean performBinaryCheck(InputStream input)
                                   throws Exception

        Checks if the given stream contains a document, supported by this format instance

        Parameters:
        input - Document content stream
        Returns:
        True, if the document can be loaded by this format instance and false otherwise
        Throws:
        Exception