rebuild.util.io
Class File

java.lang.Object
  extended by rebuild.util.io.File

public final class File
extends java.lang.Object

Various file related methods for the Blackberry.

Since:
BBX 1.0.1

Method Summary
static boolean Delete(java.lang.String path)
          Deletes a file.
static boolean EnsureCreation(java.lang.String path)
          If a file does not exist then this method will make sure any folders and subfolders are created.
static boolean Exists(java.lang.String path)
          Determines whether the specified file exists.
static boolean isFile(FileConnection file)
          Checks if the URL passed to the Connector.open() is a file.
static boolean Move(java.lang.String originalPath, java.lang.String newPath)
          Move a file from one location to another.
static boolean Move(java.lang.String originalPath, java.lang.String newPath, boolean sameName)
          Move a file from one location to another.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

Exists

public static boolean Exists(java.lang.String path)
Determines whether the specified file exists.

Parameters:
path - The file to check.
Returns:
true if the caller has the required permissions and path contains the name of an existing file; otherwise, false. This method also returns false if path is null or a zero-length string. If the caller does not have sufficient permissions to read the specified file, no exception is thrown and the method returns false regardless of the existence of path.

Delete

public static boolean Delete(java.lang.String path)
Deletes a file.

Parameters:
path - The file to delete.
Returns:
True if the file was deleted, false if otherwise.

EnsureCreation

public static boolean EnsureCreation(java.lang.String path)
If a file does not exist then this method will make sure any folders and subfolders are created.

Parameters:
path - The path to the file that is to be created.
Returns:
true if the file can be created, false if otherwise.

isFile

public static boolean isFile(FileConnection file)
Checks if the URL passed to the Connector.open() is a file.

Parameters:
file - The FileConnection to check if it is a file.
Returns:
true if the connection's target is a file, otherwise false.

Move

public static boolean Move(java.lang.String originalPath,
                           java.lang.String newPath)
Move a file from one location to another.

Parameters:
originalPath - The original file path.
newPath - The new file path.
Returns:
true if the file was moved, false if otherwise.

Move

public static boolean Move(java.lang.String originalPath,
                           java.lang.String newPath,
                           boolean sameName)
Move a file from one location to another.

Parameters:
originalPath - The original file path.
newPath - The new file path.
sameName - If a different filename is given should it be changed to the original filename?
Returns:
true if the file was moved, false if otherwise.