org.appcelerator.titanium.io
Class TiBaseFile

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

public abstract class TiBaseFile
extends Object

This is the parent class of all files/directories.


Method Summary
 boolean exists()
           
 List<String> getDirectoryListing()
           
abstract  InputStream getInputStream()
          Implementing subclasses should return an InputStream that can be used to retrieve the contents of the file.
abstract  File getNativeFile()
          Implementing subclasses should return the file object.
abstract  OutputStream getOutputStream()
          Implementing subclasses should return an OutputStream for writing to the file.
 TiBaseFile getParent()
           
 boolean isDirectory()
           
 boolean isExecutable()
           
 boolean isFile()
           
 boolean isHidden()
           
 boolean isReadonly()
           
 boolean isSymbolicLink()
           
 boolean isWriteable()
           
 String name()
           
 String nativePath()
           
 

Method Detail

isFile

public boolean isFile()
Returns:
true if the file is a File, false otherwise. See File.isFile() for more details.

isDirectory

public boolean isDirectory()
Returns:
true if the file is a directory, false otherwise. See File.isDirectory() for more details.

isExecutable

public boolean isExecutable()
Returns:
true if the file is executable, false otherwise.

isReadonly

public boolean isReadonly()
Returns:
true if the file is read-only, false otherwise.

isWriteable

public boolean isWriteable()
Returns:
true if the file is writable, false otherwise.

isHidden

public boolean isHidden()
Returns:
true if the file is hidden, false otherwise.

isSymbolicLink

public boolean isSymbolicLink()
Returns:
true if the file is a symbolic link, false otherwise.

exists

public boolean exists()
Returns:
Whether or not this file exists.

getDirectoryListing

public List<String> getDirectoryListing()
Returns:
a list of all files and directories in this directory.

getParent

public TiBaseFile getParent()
Returns:
The parent directory of this file

name

public String name()
Returns:
the file's name.

nativePath

public String nativePath()
Returns:
the file's path.

getInputStream

public abstract InputStream getInputStream()
                                    throws IOException
Implementing subclasses should return an InputStream that can be used to retrieve the contents of the file.

Returns:
the InputStream of the file.
Throws:
IOException - the thrown exception.

getOutputStream

public abstract OutputStream getOutputStream()
                                      throws IOException
Implementing subclasses should return an OutputStream for writing to the file.

Returns:
the OutputStream of the file.
Throws:
IOException - the thrown exception.

getNativeFile

public abstract File getNativeFile()
Implementing subclasses should return the file object.

Returns:
the file object.


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