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
refactor(android): temp file handling #12161
Conversation
- Moved Ti.Filesystem.tempDirectory location: * From: ./<app>/cache/_tmp * To: ./<app>/cache/.titanium/tmp - Moved Ti.Filesystem.createTempFile() location: * From: Ti.Filesystem.applicationCacheDirectory * To: Ti.Filesystem.tempDirectory - Moved Ti.Filesystem.createTempDirectory() location: * From a directory Titanium did not provide a constant for. * To: Ti.Filesystem.tempDirectory - Modified HTTP response cache file handling: * Moved from external storage to internal storage for privacy. * Now supports caching if app does not have WRITE_EXTERNAL_STORAGE permission. (No longer requires this permission.) * No longer monitors external storage mounting/unmounting. - Simplified temp file deletion via hidden "trash" folder. - Partially removed usage of "TiTempFileHelper.java" class. Will fully remove in next commit. Fixes TIMOB-28058
|
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.
This is nice, looks like it simplifies things much more and feels like much less of a hassle to not need external storage/mounting to deal with here.
android/titanium/src/java/org/appcelerator/titanium/TiApplication.java
Outdated
Show resolved
Hide resolved
FR Passed |
JIRA:
Summary:
Ti.Filesystem.tempDirectory
location:file:///.../<PackageName>/cache/_tmp
file:///.../<PackageName>/cache/.titanium/tmp
Ti.Filesystem.createTempFile()
location:Ti.Filesystem.applicationCacheDirectory
Ti.Filesystem.tempDirectory
(Matches iOS' behavior.)Ti.Filesystem.createTempDirectory()
location:Ti.Filesystem.tempDirectory
(Matches iOS' behavior.)file:///.../<PackageName>/cache/.titanium/http-response-cache
WRITE_EXTERNAL_STORAGE
permission. (This is new.)TiTempFileHelper
Java class.Test:
<None>
file:///.../cache/.titanium/tmp/RootTempFile.txt
file:///.../cache/.titanium/tmp/tifile<Numbers>.tmp
file:///.../cache/.titanium/tmp/tidir<Numbers>/SubdirectoryFile.txt
file:///.../cache/.titanium/tmp/RootTempFile.txt
file:///.../cache/.titanium/tmp/tifile<Numbers>.tmp
file:///.../cache/.titanium/tmp/tifile<Numbers>.tmp
file:///.../cache/.titanium/tmp/tidir<Numbers>/SubdirectoryFile.txt
file:///.../cache/.titanium/tmp/tidir<Numbers>/SubdirectoryFile.txt
<None>