org.appcelerator.titanium.io
Class TiFileFactory

java.lang.Object
  extended by org.appcelerator.titanium.io.TiFileFactory

public class TiFileFactory
extends Object

A helper class used to create Titanium files.


Method Summary
static TiBaseFile createTitaniumFile(String[] parts, boolean stream)
          Creates a TiBaseFile object given the path.
static TiBaseFile createTitaniumFile(String path, boolean stream)
          Identical to createTitaniumFile(String[], boolean) except that the path is passed in as a single string instead of an array of path components.
static File getDataDirectory(boolean privateStorage)
          Retrieves/creates a data directory in which the application can place its own custom data files.
 

Method Detail

createTitaniumFile

public static TiBaseFile createTitaniumFile(String path,
                                            boolean stream)
Identical to createTitaniumFile(String[], boolean) except that the path is passed in as a single string instead of an array of path components.

Parameters:
path - the path of the file
stream - this is not being used
Returns:
a TiBaseFile instance

createTitaniumFile

public static TiBaseFile createTitaniumFile(String[] parts,
                                            boolean stream)
Creates a TiBaseFile object given the path. If the URI scheme portion of the passed path is not a member of: {"app://" , "appdata://" , "appdata-private://" , "file://", "content://" }, the file will be created in "appdata-private://" + path, where path is the given path.

Parameters:
parts - A String Array containing parts of a file path.
stream - this is not being used.
Returns:
a TiBaseFile instance.

getDataDirectory

public static File getDataDirectory(boolean privateStorage)
Retrieves/creates a data directory in which the application can place its own custom data files. Refer to getDataDirectory(boolean) for more details.

Parameters:
privateStorage - determines the location of the data directory. If this is true, the location is internal(app-data://), and external (SD) otherwise.
Returns:
the data directory.


Copyright © 2010-2012 Appcelerator, Inc. Licensed under the Apache License 2.0