Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23495] iOS: Support parent property on Ti.Filesystem.File

GitHub Issuen/a
TypeImprovement
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2017-11-14T00:12:03.000+0000
Affected Version/sn/a
Fix Version/sRelease 7.0.0
ComponentsiOS
Labelsparity
ReporterChristopher Williams
AssigneeHans Knöchel
Created2016-06-10T19:01:45.000+0000
Updated2017-11-14T22:59:49.000+0000

Description

iOS is the only platform that doesn't support Ti.Filesystem.File.parent property. We should ideally support it for parity's sake.

Comments

  1. Hans Knöchel 2017-08-08

    PR: https://github.com/appcelerator/titanium_mobile/pull/9285 Test-Case (additionally to the unit-test):
       var win = Ti.UI.createWindow({
         backgroundColor: '#fff'
       });
        
       var btn = Ti.UI.createButton({
         title: 'Log parent file path'
       });
        
       btn.addEventListener('click', function() {
         var file = Ti.Filesystem.getFile('app.js');
         
         Ti.API.warn('Native Path (File):');
         Ti.API.warn(file.nativePath); // Will return the file path
       
         Ti.API.warn('Getter (file.getParent()): Should return a (deprecated) String reference');
           
         Ti.API.warn(file.getParent()); // Will return the parent path
         
         Ti.API.warn('Property (file.parent): Should return a Ti.Filesystem.File reference');
       
         Ti.API.warn(file.parent); // Will print the path of the file because of the class-description
         Ti.API.warn(file.parent.nativePath); // Will return the paren path
         Ti.API.warn(file.parent.getNativePath()); // Will return the parent path
       
       });
        
       win.add(btn);
       win.open();
       
  2. Abir Mukherjee 2017-11-14

    FR passed; PR merged.
  3. Eric Wieber 2017-11-14

    Verified in SDK build: 7.0.0.v20171114134144

JSON Source