[TIMOB-13440] TiAPI: Titanium.Filesystem.File setHidden() throws an exception
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Low |
| Status | Open |
| Resolution | Unresolved |
| Affected Version/s | Release 3.1.0 |
| Fix Version/s | n/a |
| Components | Core |
| Labels | n/a |
| Reporter | Ankit Thakur |
| Assignee | Unknown |
| Created | 2012-11-16T11:28:17.000+0000 |
| Updated | 2018-02-28T20:03:46.000+0000 |
Description
Titanium.Filesystem.File's setter method setHidden(), throws exception (setHidden method not found) in Android platform and is not hiding the files in iOS.
*Provided test case*
var rootDirectoryPath = Titanium.Filesystem.getExternalStorageDirectory();
var directoryPath = String.format('%s%s', rootDirectoryPath, 'ImagesFolder');
var directory = Titanium.Filesystem.getFile(directoryPath);
if (!directory.exists()) {
directory.createDirectory();
}
var imagePath = String.format('%s%s%s', directoryPath, fileSeperator, 'image.png');
var file = Titanium.Filesystem.getFile(imagePath);
file.write(image);
file.setHidden(true);
*Simplified test case*
var file = Titanium.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, '', 'KS_nav_ui.png');
file.setHidden(true);
Tested and confirmed on Samsung Galaxy S3 Android 4.0.4 with Ti SDK 3.1 CI. Throws an exception; iOS doesn't. Not tested "hidden" behavior, but at the very least the documentation needs updating.