java.lang.Object | ||||
↳ | android.content.ContentProvider | |||
↳ | androidx.core.content.FileProvider | |||
↳ | com.pspdfkit.internal.utilities.BaseFileProvider | |||
↳ | com.pspdfkit.document.sharing.DocumentSharingProvider |
Provider allowing access to shared files. To use this provider you just need to add this to your
AndroidManifest.xml
:
<provider
android:name="com.pspdfkit.document.sharing.DocumentSharingProvider"
android:authorities="[your application package name].pdf.share"
android:exported="true"
android:grantUriPermissions="true" />
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
DocumentSharingProvider() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static void |
checkProviderConfiguration(Context context)
Tests if
DocumentSharingProvider is configured correctly in AndroidManifest.xml . | ||||||||||
static Uri |
createTemporaryFile(Context context, String fileName, String fileExtension)
Creates temporary file and returns its
Uri . | ||||||||||
static boolean |
deleteFile(Context context, Uri sharedFileUri)
Deletes file handled by this provider.
| ||||||||||
static String |
getDocumentProviderAuthority(Context context)
Returns authority for this
DocumentSharingProvider . | ||||||||||
static File |
getSharedFileDirectory(Context context)
Returns directory from which
DocumentSharingProvider can share files. | ||||||||||
static File |
getTempFileDirectory(Context context)
Returns directory from which
DocumentSharingProvider can share temporary files. | ||||||||||
static Uri |
getUriForFile(Context context, File fileName)
Return a content URI for a file stored in
getSharedFileDirectory(Context) directory. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Tests if DocumentSharingProvider
is configured correctly in AndroidManifest.xml
.
context | Context of the calling component, used for accessing files. |
---|
PSPDFKitException | when provider is not configured correctly. |
---|
Deletes file handled by this provider.
context | The context ot use. |
---|---|
sharedFileUri | Uri of file that should be removed. |
Returns authority for this DocumentSharingProvider
.
context | Context of the calling component, used for accessing files. |
---|
Returns directory from which DocumentSharingProvider
can share files. Note that all
files in this directory may be readable by other applications so make sure to not store any
sensitive data there.
getCacheDir()
directory.IllegalStateException | If directory couldn't be created. |
---|
Returns directory from which DocumentSharingProvider
can share temporary files. Note
that all files in this directory may be readable by other applications so make sure to not
store any sensitive data there.
getCacheDir()
directory.IllegalStateException | If directory couldn't be created. |
---|
Return a content URI for a file stored in getSharedFileDirectory(Context)
directory.
context | Context of the calling component, used for accessing files. |
---|---|
fileName | File name of the targeted file, must be part of the shared directory. |