Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #6 and support for delete. #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

deakjahn
Copy link

@deakjahn deakjahn commented Jan 13, 2025

I'll add a few review comments to describe individual changes.

The major one is adding support for deleting files, that's more or less obvious, copied and modified another command.

@@ -46,6 +49,8 @@ data class SaveFileInfo(val filePath: String?, val fileData: ByteArray?, val fil
result = 31 * result + fileName.hashCode()
return result
}

override fun toString() = "SaveFileInfo(filePath=$filePath fileName=$fileName)"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to dump a possibly large binary file into the log.

@@ -139,6 +144,7 @@ fun saveMultipleFiles(

val begin = System.nanoTime()

destinationSaveFilesInfo.clear()
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug mentioned in #6.

@@ -258,7 +259,7 @@ class Utils {
val saveFileNamePrefix: String =
destinationSaveFilesInfo.elementAt(index).saveFileNamePrefix
val documentFileNewFile = outputFolder!!.createFile(
sourceFileMimeType ?: "application/random", saveFileNamePrefix
sourceFileMimeType ?: "application/octet-stream", saveFileNamePrefix
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no application/random, this one is the generic format.

@@ -341,7 +348,7 @@ class SaveFileInfo {
/// Required if [fileData] is provided.
final String? fileName;

/// Create parameters for the [fileMetaData] method.
/// Create parameters for the [fileSaver] method.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a copying typo.

@@ -365,7 +372,7 @@ class SaveFileInfo {
// when using the print statement.
@override
String toString() {
return 'SaveFileInfo{filePath: $filePath, fileData: $fileData, fileName: $fileName}';
return 'SaveFileInfo{filePath: $filePath, fileName: $fileName}';
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to dump a possibly large binary file into the log.

@chaudharydeepanshu
Copy link
Owner

Thanks for the PR and the comments. I will review it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants