rebuild.util.io
Class Directory

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

public final class Directory
extends java.lang.Object

Various directory related methods for the Blackberry.

Since:
BBX 1.0.1

Method Summary
static boolean Delete(java.lang.String path)
          Deletes a directory.
static boolean EnsureCreation(java.lang.String path)
          If a directory 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 given path refers to an existing directory on the device.
static boolean isDirectory(FileConnection file)
          Checks if the URL passed to the Connector.open() is a directory.
static boolean Move(java.lang.String originalPath, java.lang.String newPath)
          Move a directory 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 given path refers to an existing directory on the device.

Parameters:
path - The path to test.
Returns:
true if path refers to an existing directory; otherwise, false.

EnsureCreation

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

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

isDirectory

public static boolean isDirectory(FileConnection file)
Checks if the URL passed to the Connector.open() is a directory. The difference between this and the FileConnection's FileConnection#isDirectory() function is this will check if it is a directory regardless of if it exists already.

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

Delete

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

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

Move

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

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