SHOW Signed

net.rim.device.api.io
Class File

java.lang.Object
  |
  +--net.rim.device.api.io.File

public final class File
extends Object

Provides low-level access to various file systems. This class provides acces to only the iDEN file system. To access file systems such as the device store or SDCard use the javax.microedition.io.file classes.

Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

Since:
JDE 4.0.2
See Also:
FileConnection

Field Summary
 Category: Signed static int FILESYSTEM_PATRIOT
          File system built into iDEN devices.
 
Method Summary
 Category: Signed static void delete(int fs, String fileName)
          Deletes the specified file.
 Category: Signed static String findFirst(int fs, String pattern)
          Finds the first file that matches the specified pattern.
 Category: Signed static boolean findFirst(int fs, String pattern, FileInfo fileInfo)
          Finds the first file that matches the specified pattern.
 Category: Signed static String findNext(int fs)
          Finds the next file that matches the specified pattern.
 Category: Signed static boolean findNext(int fs, FileInfo fileInfo)
          Finds the next file that matches the specified pattern.
 Category: Signed static long getFileSize(int fs, String fileName)
          Retrieves the size of the specified file.
 Category: Signed static long getFileSystemFreeSpace(int fs)
          Retrieves the free space for the specified file system.
 Category: Signed static long getFileSystemTotalSpace(int fs)
          Retrieves the total size for the specified file system.
 Category: Signed static boolean isFileSystemSupported(int fs)
          Determines if this device supports the specified file system.
 Category: Signed static boolean isSupported()
          Determines if this device supports one or more file systems.
 Category: Signed static void rename(int fs, String oldFileName, String newFileName)
          Renames the specified file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILESYSTEM_PATRIOT

public static final int FILESYSTEM_PATRIOT
File system built into iDEN devices.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Method Detail

delete

public static void delete(int fs,
                          String fileName)
                   throws IOException
Deletes the specified file.
Parameters:
fs - One of the FILESYSTEM_ values.
fileName - The name of the file.
Throws:
IOException - if a file with the specified name does not exist on the specified filesystem.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

findFirst

public static String findFirst(int fs,
                               String pattern)
                        throws IOException
Finds the first file that matches the specified pattern.
Parameters:
fs - One of the FILESYSTEM_ values.
pattern - A pattern to search within file names. This pattern can include wildcard characters (*).
Returns:
The file name of the first file that matches the pattern specified, or null if no file matches.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

findFirst

public static boolean findFirst(int fs,
                                String pattern,
                                FileInfo fileInfo)
                         throws IOException
Finds the first file that matches the specified pattern.
Parameters:
fs - One of the FILESYSTEM_ values.
pattern - A pattern to search within file names. This pattern can include wildcard characters (*).
fileInfo - A FileInfo instance to receive the file information.
Returns:
True if a file was found that matches the pattern specifed; false otherwise.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

findNext

public static String findNext(int fs)
                       throws IOException
Finds the next file that matches the specified pattern.
Parameters:
fs - One of the FILESYSTEM_ values.
Returns:
The next file that matches the pattern specified in a previous call to findFirst, or null if there are no more matches.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

findNext

public static boolean findNext(int fs,
                               FileInfo fileInfo)
                        throws IOException
Finds the next file that matches the specified pattern.
Parameters:
fs - One of the FILESYSTEM_ values.
fileInfo - A FileInfo instance to receive the file information.
Returns:
True if a file was found matching the pattern specifed; false otherwise.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getFileSize

public static long getFileSize(int fs,
                               String fileName)
                        throws IOException
Retrieves the size of the specified file.

Note: Calling this method resets any findFirst or findNext query in progress.

Parameters:
fs - One of the FILESYSTEM_ values.
fileName - The name of the file.
Returns:
The size of the file in bytes.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getFileSystemFreeSpace

public static long getFileSystemFreeSpace(int fs)
                                   throws IOException
Retrieves the free space for the specified file system.
Parameters:
fs - One of the FILESYSTEM_ values.
Returns:
The number of available bytes in the file system.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getFileSystemTotalSpace

public static long getFileSystemTotalSpace(int fs)
                                    throws IOException
Retrieves the total size for the specified file system.
Parameters:
fs - One of the FILESYSTEM_ values.
Returns:
The total number of bytes in the file system.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

isFileSystemSupported

public static final boolean isFileSystemSupported(int fs)
Determines if this device supports the specified file system.
Parameters:
fs - One of the FILESYSTEM_ values.
Returns:
True if this device provides access to the specified file system.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

isSupported

public static final boolean isSupported()
Determines if this device supports one or more file systems.
Returns:
True if this device provides access to one or more file systems.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

rename

public static void rename(int fs,
                          String oldFileName,
                          String newFileName)
                   throws IOException
Renames the specified file.
Parameters:
fs - One of the FILESYSTEM_ values.
oldFileName - The name of the file.
newFileName - The new name for the file.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.


Copyright 1999-2007 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.