public final class

DocumentSource

extends Object
java.lang.Object
   ↳ com.pspdfkit.document.DocumentSource

Class Overview

Represents a document source which may be a DataProvider or a file Uri.

Summary

Public Constructors
DocumentSource(Uri fileUri)
Creates a new DocumentSource with file Uri as a source.
DocumentSource(Uri fileUri, String password)
Creates a new DocumentSource with file Uri as a source.
DocumentSource(Uri fileUri, String password, String contentSignature)
Creates a new DocumentSource with file Uri as a source.
DocumentSource(DataProvider dataProvider)
Creates a new DocumentSource with a DataProvider as a source.
DocumentSource(DataProvider dataProvider, String password)
Creates a new DocumentSource with a DataProvider as a source.
DocumentSource(DataProvider dataProvider, String password, String contentSignature)
Creates a new DocumentSource with a DataProvider as a source.
Public Methods
DocumentSource cloneWithPassword(String newPassword)
Returns a copy of this source with new password set.
boolean equals(Object o)
String getContentSignature()
Returns content signature of the document if any was set.
DataProvider getDataProvider()
Returns a DataProvider for this source.
Uri getFileUri()
Returns a file Uri if this is an Uri source.
String getPassword()
Returns password for unlocking currently pointed to file.
synchronized String getUid()
Returns Uid of this document source.
int hashCode()
boolean isFileSource()
Returns true if the source is a file URI not a data provider.
String toString()
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public DocumentSource (Uri fileUri)

Creates a new DocumentSource with file Uri as a source.

Parameters
fileUri Uri of the PDF file.

public DocumentSource (Uri fileUri, String password)

Creates a new DocumentSource with file Uri as a source.

Parameters
fileUri Uri of the PDF file.
password Password to unlock the file. Can be null if no password is required.

public DocumentSource (Uri fileUri, String password, String contentSignature)

Creates a new DocumentSource with file Uri as a source.

Parameters
fileUri Uri of the PDF file.
password Password to unlock the file. Can be null if no password is required.
contentSignature An RSA encrypted SHA256 hash of the document if required by license, may be null.

public DocumentSource (DataProvider dataProvider)

Creates a new DocumentSource with a DataProvider as a source.

Parameters
dataProvider DataProvider for accessing the document to open.

public DocumentSource (DataProvider dataProvider, String password)

Creates a new DocumentSource with a DataProvider as a source.

Parameters
dataProvider DataProvider for accessing the document to open.
password Password to unlock the PDF. Can be null if no password is required.

public DocumentSource (DataProvider dataProvider, String password, String contentSignature)

Creates a new DocumentSource with a DataProvider as a source.

Parameters
dataProvider DataProvider for accessing the document to open.
password Password to unlock the PDF. Can be null if no password is required.
contentSignature An RSA encrypted SHA256 hash of the document if required by license, may be null.

Public Methods

public DocumentSource cloneWithPassword (String newPassword)

Returns a copy of this source with new password set.

Parameters
newPassword new password value, can be null
Returns

public boolean equals (Object o)

public String getContentSignature ()

Returns content signature of the document if any was set.

Returns
  • content signature or null if none is set.

public DataProvider getDataProvider ()

Returns a DataProvider for this source.

Returns
  • DataProvider this source points to or null if this is a file Uri source.

public Uri getFileUri ()

Returns a file Uri if this is an Uri source.

Returns

public String getPassword ()

Returns password for unlocking currently pointed to file.

Returns
  • password or null if none is set.

public synchronized String getUid ()

Returns Uid of this document source.

public int hashCode ()

public boolean isFileSource ()

Returns true if the source is a file URI not a data provider.

Returns
  • true if this source has file Uri, false if not.

public String toString ()