DocumentStoreStrategy

class DocumentStoreStrategy(context: Context, preferences: SharedPreferences)

Provides java.io.File directories for saving Document

The structure of the document folder is the following: {documents_directory}/document UUID -------{document_name}.pdf -------{thumbnail}

Constructors

Link copied to clipboard
constructor(context: Context, preferences: SharedPreferences)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard

Creates directory for Document if not exists.

Link copied to clipboard
fun eraseDocument(docId: String, docName: String)

Deletes Document directory and all its pages from file system Use from BG thread only

Link copied to clipboard

Deletes Document thumbnail Use from BG thread only

Link copied to clipboard
fun getDocumentDir(docId: String?): File
Link copied to clipboard
fun getDocumentFile(docId: String, name: String): File
Link copied to clipboard
fun getPageImagePath(pagePosition: Int, document: Document): String
Link copied to clipboard
Link copied to clipboard
fun getUniqueName(newName: String): String

Recursively trying to find unique name for pdf document in pdf files directory

Link copied to clipboard
fun migrateDocuments(newPath: String?, documents: List<Document>)

Migrates all pdf files to directory specified in preferences PreferencesConstants.EXTERNAL_DIR or default directory Constants.DEFAULT_EXTERNAL_DIR_NAME or from external directory to internal application document directories.

Link copied to clipboard
fun renameDocument(docId: String, oldName: String, newName: String): Boolean

Renames document. Use from BG thread only