Package com.pspdfkit.document.files
Class EmbeddedFileSource
-
- All Implemented Interfaces:
public class EmbeddedFileSource
Represents a source of embedded file data.
-
-
Field Summary
Fields Modifier and Type Field Description public String
fileName
public long
fileSize
public final String
fileDescription
-
Constructor Summary
Constructors Constructor Description EmbeddedFileSource(DataProvider fileDataProvider, String fileName, String fileDescription)
Constructs an embedded file source with data served from DataProvider. EmbeddedFileSource(Uri fileUri, String fileName, String fileDescription)
Constructs an embedded file source with data served from file content provider URI. EmbeddedFileSource(Array<byte> fileData, String fileName, String fileDescription)
Constructs an embedded file source with data served from memory.
-
Method Summary
Modifier and Type Method Description String
getFileName()
Returns name of the file. long
getFileSize()
Returns file size. String
getFileDescription()
Returns file description. DataProvider
getDataProvider()
Returns data provider with data for the embedded file. -
-
Constructor Detail
-
EmbeddedFileSource
EmbeddedFileSource(DataProvider fileDataProvider, String fileName, String fileDescription)
Constructs an embedded file source with data served from DataProvider.- Parameters:
fileDataProvider
- Provider for file's data that will be saved in the document.fileName
- User displayable name of the file.fileDescription
- The optional description of the file.
-
EmbeddedFileSource
EmbeddedFileSource(Uri fileUri, String fileName, String fileDescription)
Constructs an embedded file source with data served from file content provider URI.- Parameters:
fileUri
- A content provider URI with supported scheme (content://
orfile://
).fileName
- User displayable name of the file.fileDescription
- The optional description of the file.
-
EmbeddedFileSource
EmbeddedFileSource(Array<byte> fileData, String fileName, String fileDescription)
Constructs an embedded file source with data served from memory.- Parameters:
fileData
- File data that will be saved in the document.fileName
- User displayable name of the file.fileDescription
- The optional description of the file.
-
-
Method Detail
-
getFileName
@NonNull() String getFileName()
Returns name of the file.
-
getFileSize
long getFileSize()
Returns file size.
- Returns:
File size in bytes or FILE_SIZE_UNKNOWN if size could not be determined.
-
getFileDescription
@Nullable() String getFileDescription()
Returns file description.
- Returns:
File description or
null
if not set.
-
getDataProvider
@NonNull() DataProvider getDataProvider()
Returns data provider with data for the embedded file.
- Returns:
Instance of data provider serving file's data.
-
-
-
-