Class SimplePasswordProvider

java.lang.Object
org.apache.tika.parser.SimplePasswordProvider
All Implemented Interfaces:
Serializable, PasswordProvider

public class SimplePasswordProvider extends Object implements PasswordProvider
A simple PasswordProvider that returns a configured password for all documents. This can be configured via JSON in the parseContext:
 {
   "parseContext": {
     "simple-password-provider": {
       "password": "secret"
     }
   }
 }
 
Since:
Apache Tika 4.0
See Also:
  • Constructor Details

    • SimplePasswordProvider

      public SimplePasswordProvider()
    • SimplePasswordProvider

      public SimplePasswordProvider(String password)
  • Method Details

    • getPassword

      public String getPassword(Metadata metadata)
      Description copied from interface: PasswordProvider
      Looks up the password for a document with the given metadata, and returns it for the Parser. If no password is available for the document, will return null.
      Specified by:
      getPassword in interface PasswordProvider
      Parameters:
      metadata - document metadata
      Returns:
      The document decryption password, or null if not known
    • getPassword

      public String getPassword()
    • setPassword

      public void setPassword(String password)