Details
Description
Summary:
When passing an Android "content://" URL to the Ti.Filesystem.getFile() method, the returned File object does not support the following methods/properties. They will return failure results and log a "Method is not supported" warning.
- File.createdAt()
- File.deleteFile()
- File.exists()
- File.extension()
- File.modifiedAt()
- File.read()
- File.readonly
- File.write()
- File.writable
We should add the above methods for consistency.
Note:
The File object already correctly implements all other methods and properties for a "content://" URL such as the copy() method and "nativePath" property. Adding the above methods will help make the interface more complete and avoid confusion.
Implementation:
We need to add the above methods to our TitaniumBlob Java class.
https://github.com/appcelerator/titanium_mobile/blob/master/android/titanium/src/java/org/appcelerator/titanium/io/TitaniumBlob.java
We can test the inclusion of these methods with the attached FileContentUrlTest.js file. This test script assumes its was created via a Classic Default project template.
Attachments
Issue Links
- relates to
-
TIMOB-27458 Parity: Ti.Filesystem.getFile inconsistent in support of various URIs across platforms
-
- Open
-