- Added support for picking directories with persistent permission and return its uri.
- Added support to optionally traverse through all subdirectories in a picked directory and return their uris.
- Added support to selectively traverse starting through a directory whose uri we stored from previous traverse.
- Support for cancelling the ongoing directory traversing.
- Added support to provide mime types and extensions list when traversing, to only get those types of documents in result.
- Added support for getting all persistent permission uris from device.
- Added support for checking persistent permission status of uri.
- Added support for releasing a persistent permission for a uri.
- Improved intents handling.
- Updated documentation.
- Updated example.
- Updated documentation.
- Fixed the issue of unintentionally clearing other tasks results in the plugin when one tasks finishes in the plugin.
- Updated documentation.
- Breaking:
copyFileToCacheDir
is replaced withgetCachedFilePath
. - Updated documentation.
- Breaking:
cacheFilePathFromUri
is replaced withcacheFilePathFromPath
. - Fixed unable to save multiple due to the changes in 2.0.1.
-
Breaking:
FileMetadataParams
now only takesfilePath
which can take both absolute file path or Uri so I removedsourceFilePath
andsourceFileUri
. -
Breaking:
CacheFilePathFromUriParams
is replaced withCacheFilePathFromPathParams
. -
Breaking:
CacheFilePathFromPathParams
now only takesfilePath
which can take both absolute file path or Uri so I removedfileUri
. -
Breaking: Now if
copyFileToCacheDir
set to true the returned path file name will be different from picked file name.This was done to avoid deleting or rewriting existing cache files with same name.
But you can still get the original name by following the pattern.
For example:- If you pick a file with name "My Test File.pdf" then the cached file will be something like this "My Test File.8190480413118007032.pdf". From that we see the pattern would be "original name prefix"+"."+"random numbers"+"."+"file extension". So what we need to do is to just remove the "."+"random numbers" to get the real name. Look at the below code:
String getRealName(String pickOrSaveCachedFileName) {
int indexOfExtDot = pickOrSaveCachedFileName.lastIndexOf('.');
if (indexOfExtDot == -1) {
return pickOrSaveCachedFileName;
} else {
String fileExt =
pickOrSaveCachedFileName.substring(indexOfExtDot).toLowerCase();
String fileNameWithoutExtension = pickOrSaveCachedFileName.substring(
0, pickOrSaveCachedFileName.length - fileExt.length);
int indexOfRandomNumDot = fileNameWithoutExtension.lastIndexOf('.');
if (indexOfRandomNumDot == -1) {
return pickOrSaveCachedFileName;
} else {
String dotAndRandomNum =
fileNameWithoutExtension.substring(indexOfRandomNumDot).toLowerCase();
String fileNameWithoutDotAndRandomNumAndExtension =
fileNameWithoutExtension.substring(
0, fileNameWithoutExtension.length - dotAndRandomNum.length);
return fileNameWithoutDotAndRandomNumAndExtension + fileExt;
}
}
}
- Fixes app crash due to
java.lang.IllegalStateException: Reply already submitted
. - Recreated example to easily try all functionalities of plugin.
-
Breaking:
filePickingType
is replaced withenableMultipleSelection
. -
Added support photo picker.
To use photo picker set
pickerType
toPickerType.photo
and then set themimeTypesFilter
.Note 1: Photo picker only supports single mime type so
mimeTypesFilter
first value should be valid such as image mime(image/) or video mime(video/) or both(/).Note 2: For Photo picker
allowedExtensions
doesn't automatically combines withmimeTypeFilter
by detecting mimeType from extensions because of note 1. But still the result would contain only files with extension provided inallowedExtensions
.Note 3: If photo picker is not available on the users device then we automatically fallback to
PickerType.file
. -
Fixed
mimeTypesFilter
not working forfilePicker
.
- Breaking:
mimeTypeFilter
is replaced withmimeTypesFilter
everywhere. - Fixed
localOnly
forfileSaver
andfilePicker
not working as intended. - Fixed
fileSaver
only opening download folder for when saving single file due to the updates made in version 1.0.1. - Fixed
mimeTypesFilter
not working forfileSaver
. - Fixed
fileSaver
giving error instead of file paths when saving multiple files even after saving files successfully due to the updates made in version 1.0.1.
- Fixed
copyFileToCacheDir
and few other things not working due to the updates made in version 1.0.1. - Added
cacheFilePathFromUri
to create a cache file from uri and get the cached file path.
-
Breaking: Now
allowedExtensions
automatically combines withmimeTypeFilter
by detecting mimeType from extensions. -
Breaking: Use
saveFiles
assourceFilesPaths
,data
,filesNames
are removed (see updated documentation or example).saveFiles
takes list ofSaveFileInfo()
andSaveFileInfo()
takesfilePath
,fileData
andfileName
.This removes the limitation of only using either file path or file data for saving files as it can take many
SaveFileInfo()
objects created through file path or file data. -
Project completely refactored.
- Fixed
allowedExtensions
for files picking.
- Added
cancelFilesSaving()
to cancel saving files. - Automatically cancels ongoing saving of files when trying to save new files.
- Fixed example.
- Added more assertions on saving files.
- Tackles exceptions and errors.
- Fixes "Dialog already active" error on retrying a failed save.
- Fixes file metadata not working for URI.
- Allows using absolute file path for metadata.
- Breaking: Use
sourceFileUri
for URIs andsourceFilePath
for absolute file paths to get metadata.
- Fixes file metadata last modified format.
- Adds function to get metadata of a uri.
- Fixes mimeTypeFilter not working.
- Fixes changelog.
- Initial release.