Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7185] TI API: Add Ti.Filesystem.privateDocuments

GitHub Issuen/a
TypeNew Feature
PriorityTrivial
StatusClosed
ResolutionWon't Fix
Resolution Date2016-11-08T12:10:47.000+0000
Affected Version/sRelease 1.8.0.1
Fix Version/sn/a
ComponentsTiAPI
Labelsparity
ReporterStephen Tramer
AssigneeIngo Muschenetz
Created2012-01-13T16:15:28.000+0000
Updated2017-03-23T22:31:45.000+0000

Description

For iOS (at least) we need to add a property to access Library/Private Documents which is the new location of database files and is generally useful for material which should not necessarily be backed up to iCloud (Apple has extensive docs about what which directories should be used for and the backup schemes for each). Unsure if this makes sense for Android. Any fix should include a new drillbit check for the API point and a sensible per-platform return value.

Comments

  1. Shawn Lipscomb 2012-01-18

    For cross-platform use, how about a Ti.Filesystem *applicationDatabaseDirectory* property (similar to applicationDataDirectory), which would return the location of where an installed database file _will_ live? For Android and iOS.
  2. Stephen Feather 2012-02-19

    Private Documents is not a database specific repository. The name of a new property should reflect that. One specific for the database location would be useful when reading code though. We also need a LibraryCaches as well.
  3. Hans Knöchel 2016-11-08

    As this directory is not cross-platform and developers can access it the following way on iOS, this is not a feature the SDK should expose:
       function privateDocumentsDirectory(){
        
           Ti.API.info('We need to open a file object to get our directory info');
           var testFile = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory);
           Ti.API.info('Now we remove the Documents folder reference');
           var privateDir = testFile.nativePath.replace('Documents/','');
           Ti.API.info('This is our base App Directory =' + privateDir);
           Ti.API.info('Now we add the Private Documents Directory');
           privateDir+='Library/Private%20Documents/';
           Ti.API.info('Our new path is ' + privateDir);
           return privateDir;
       };
       
    [Source](https://bencoding.com/2011/12/29/titanium-reading-files-in-the-private-documents-directory/) (by [~ben.bahrenburg@gmail.com])
  4. Lee Morris 2017-03-23

    Closing ticket as Won't Fix with reference to the above comments.

JSON Source