-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Use of Try-With-Resources #14583
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
Use of Try-With-Resources #14583
Conversation
a2b706e to
416c810
Compare
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
ce20873 to
c93aa98
Compare
d4aba9d to
fbbb777
Compare
d850f42 to
c4d4e0a
Compare
2d1225a to
d06522d
Compare
|
Pending manual tests
|
alperozturk96
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello
Thank you for the PR.
I'm currently experiencing an issue when attempting to upload files from other apps to the Nextcloud Files app.
Steps to Reproduce:
- Navigate to a folder in the app.
- Tap the "+" button at the bottom right.
- Select "Upload content from other apps".
E Could not find source file content://com.android.externalstorage.documents/document/primary%3ADownload%2Ftea%2F0003.webp
java.io.FileNotFoundException: /storage/emulated/0/Android/media/com.nextcloud.client/nextcloud/tmp/[email protected]%3A55001/b4/0003.webp: open failed: ENOENT (No such file or directory)
...
Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
I am trying this myself and cannot reproduce it. It looks like you were attempting a .webp file from your Documents folder? Do you have a full trace of this error? I'd like to see where it could be breaking, but I'm assuming it's something in the normalUpload function.... |
fd030c4 to
d9f273a
Compare
Here is the demo. Thank you. dm.mp4 |
Signed-off-by: Alex Knop <[email protected]>
|
@alperozturk96 I believe I fixed it. I had accidentally moved some commands into the try loop which were originally called before creating the FileOutputStream. This should now be synonymous with how the code was before. |
|
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/14583.apk |
alperozturk96
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested, works as expected.

Problem:
Manual cleanup code is used for resources that can be automatically managed.
Solution:
Use of Try-With-Resources to enhance the overall stability, performance, and clarity of code, ensuring better resource management and minimizing potential issues related to improper resource handling.