Class DocumentSource
-
- All Implemented Interfaces:
public final class DocumentSource
Represents a document source which may be a DataProvider or a file Uri.
-
-
Field Summary
Fields Modifier and Type Field Description public final Uri
fileUri
public final DataProvider
dataProvider
public final String
contentSignature
public final String
password
public final File
checkpointFile
public String
uid
-
Constructor Summary
Constructors Constructor Description 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. DocumentSource(Uri fileUri, DataProvider dataProvider, String password, String contentSignature)
Creates a new DocumentSource with file Uri as a source. DocumentSource(Uri fileUri, DataProvider dataProvider, String password, String contentSignature, File checkpointFile, boolean checkpointAlreadyCreated)
Creates a new DocumentSource with file Uri as a source. DocumentSource(DocumentSource documentSource, File checkpoint, boolean checkpointAlreadyCreated)
Creates a new DocumentSource with a File as a checkpoint source.
-
Method Summary
Modifier and Type Method Description Uri
getFileUri()
Returns a file Uri if this is an Uri source. DataProvider
getDataProvider()
Returns a DataProvider for this source. String
getContentSignature()
Returns content signature of the document if any was set. String
getPassword()
Returns password for unlocking currently pointed to file. File
getCheckpointFile()
Returns the current File checkpoint. synchronized String
getUid()
Returns Uid of this document source. boolean
isCheckpointAlreadyCreated()
Indicates whether the checkpoint was already created. boolean
isFileSource()
Returns true if the source is a file URI not a data provider. NativeDataDescriptor
toDataDescriptor()
Converts the DocumentSource to a NativeDataDescriptor. DocumentSource
cloneWithPassword(@Nullable() String newPassword)
Returns a copy of this source with new password set. int
hashCode()
boolean
equals(Object o)
String
toString()
-
-
Constructor Detail
-
DocumentSource
DocumentSource(Uri fileUri)
Creates a new DocumentSource with file Uri as a source.- Parameters:
fileUri
- Uri of the PDF file.
-
DocumentSource
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.
-
DocumentSource
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.contentSignature
- An RSA encrypted SHA256 hash of the document if required by license, may benull
.
-
DocumentSource
DocumentSource(DataProvider dataProvider)
Creates a new DocumentSource with a DataProvider as a source.- Parameters:
dataProvider
- DataProvider for accessing the document to open.
-
DocumentSource
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.
-
DocumentSource
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.contentSignature
- An RSA encrypted SHA256 hash of the document if required by license, may benull
.
-
DocumentSource
DocumentSource(Uri fileUri, DataProvider dataProvider, String password, String contentSignature)
Creates a new DocumentSource with file Uri as a source.
-
DocumentSource
DocumentSource(Uri fileUri, DataProvider dataProvider, String password, String contentSignature, File checkpointFile, boolean checkpointAlreadyCreated)
Creates a new DocumentSource with file Uri as a source.
-
DocumentSource
DocumentSource(DocumentSource documentSource, File checkpoint, boolean checkpointAlreadyCreated)
Creates a new DocumentSource with a File as a checkpoint source.
-
-
Method Detail
-
getFileUri
@Nullable() Uri getFileUri()
Returns a file Uri if this is an Uri source.
- Returns:
Uri of the file or
null
if this source points to a .
-
getDataProvider
@Nullable() DataProvider getDataProvider()
Returns a DataProvider for this source.
- Returns:
DataProvider this source points to or
null
if this is a file Uri source.
-
getContentSignature
@Nullable() String getContentSignature()
Returns content signature of the document if any was set.
- Returns:
content signature or
null
if none is set.
-
getPassword
@Nullable() String getPassword()
Returns password for unlocking currently pointed to file.
- Returns:
password or
null
if none is set.
-
getCheckpointFile
@Nullable() File getCheckpointFile()
Returns the current File checkpoint.
-
isCheckpointAlreadyCreated
boolean isCheckpointAlreadyCreated()
Indicates whether the checkpoint was already created.
- Returns:
true
if up-to-date checkpoint was already created on the device,false
otherwise.
-
isFileSource
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.
-
toDataDescriptor
@NonNull() NativeDataDescriptor toDataDescriptor()
Converts the DocumentSource to a NativeDataDescriptor.
-
cloneWithPassword
DocumentSource cloneWithPassword(@Nullable() String newPassword)
Returns a copy of this source with new password set.
- Parameters:
newPassword
- new password value, can benull
- Returns:
new copy of this DocumentSource.
-
hashCode
int hashCode()
-
-
-
-