All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface com.sun.install.products.FileBrowser

public interface FileBrowser
Classes implementing this interface know how to interact with the filesystem that the object's VM resides on. This interface is expected to be mode into a FileSystem service soon.


Variable Index

 o DIRECTORIES
Inficates to getList() what type of files to return.
 o FILES
Inficates to getList() what type of files to return.
 o HOME_DIR
Constant used with getNamedDirectory to return the directory for home files.
 o INSTALL_DIR
Constant used with getNamedDirectory to return the root directory for program files on the system.
 o LIB_DIR
Constant used with getNamedDirectory to return the directory for library files on the system.
 o LOG_DIR
Constant used with getNamedDirectory to return the directory for writing log file.
 o TEMP_DIR
Constant used with getNamedDirectory to return the directory for writing temporary files.

Method Index

 o canRead(String)
Tests if the application can read from the specified file.
 o createDirectory(String)
Creates a directory whose pathname is specified by dir.
 o fileExists(String)
Tests if file exists.
 o getAbsolutePath(String)
Returns the absolute pathname of the file represented by the path.
 o getList(int, String)
Gets a list of files in the supplied directory.
 o getNamedDirectory(String)
Returns the directory for the specified type.
 o getParent(String)
Returns the parent part of the pathname of this File object, or null if the name has no parent part.
 o getParentDirectory(String)
Gets the parent directory of the supplied directory. Deprecated.
 o getSeparator()
Gets the system-dependent file separator
 o isDirectory(String)
Tests if the file represented by dir is a directory.
 o logEvent(String)
Logs an event to the install logfile for this installer

Variables

 o FILES
 public static final int FILES
Inficates to getList() what type of files to return.

 o DIRECTORIES
 public static final int DIRECTORIES
Inficates to getList() what type of files to return.

 o INSTALL_DIR
 public static final String INSTALL_DIR
Constant used with getNamedDirectory to return the root directory for program files on the system.

 o LIB_DIR
 public static final String LIB_DIR
Constant used with getNamedDirectory to return the directory for library files on the system.

 o TEMP_DIR
 public static final String TEMP_DIR
Constant used with getNamedDirectory to return the directory for writing temporary files.

 o LOG_DIR
 public static final String LOG_DIR
Constant used with getNamedDirectory to return the directory for writing log file.

 o HOME_DIR
 public static final String HOME_DIR
Constant used with getNamedDirectory to return the directory for home files.

Methods

 o getSeparator
 public abstract String getSeparator()
Gets the system-dependent file separator

Returns:
The file separator of the machine that the VM holding this object is running on.
 o getParentDirectory
 public abstract String getParentDirectory(String child)
Note: getParentDirectory() is deprecated. Use getParent(String).

Gets the parent directory of the supplied directory.

Parameters:
child - The directory to get the parent of
Returns:
The parent directory of the supplied child directory, or the same directory if the directory is the root directory.
 o getList
 public abstract String[] getList(int type,
                                  String directory)
Gets a list of files in the supplied directory.

Parameters:
type - The type of entries to return in the list.
directory - The directory to get a listing of the contents of.
Returns:
A list of files of the specified type from the specified directory, or null if the directory does not exist or otherwize cannot be accessed.
 o fileExists
 public abstract boolean fileExists(String file)
Tests if file exists.

Parameters:
file - The file to test.
Returns:
true if the file specified by this object exists; false otherwise.
Throws: SecurityException
if a security manager exists, its checkRead method is called with the pathname of this File to see if the application is allowed read access to the file.
See Also:
getPath, checkRead
 o createDirectory
 public abstract boolean createDirectory(String dir)
Creates a directory whose pathname is specified by dir.

Parameters:
dir - The directory to create.
Returns:
true if the directory could be created; false otherwise.
Throws: SecurityException
if a security manager exists, its checkWrite method is called with the pathname of this File to see if the application is allowed write access to the file.
See Also:
getPath, checkWrite
 o getNamedDirectory
 public abstract String getNamedDirectory(String name)
Returns the directory for the specified type. See the XXX_DIR fields for a list of named directories supported.

Parameters:
name - the directory type name
Returns:
s the directory for the specified type.
 o canRead
 public abstract boolean canRead(String path)
Tests if the application can read from the specified file.

Parameters:
path - The path to test.
Returns:
true if the file specified by this object exists and the application can read the file; false otherwise.
Throws: SecurityException
if a security manager exists, its checkRead method is called with the pathname of this File to see if the application is allowed read access to the file.
See Also:
getPath, checkRead
 o getParent
 public abstract String getParent(String child)
Returns the parent part of the pathname of this File object, or null if the name has no parent part. The parent part is generally everything leading up to the last occurrence of the separator character, although the precise definition is system dependent. On UNIX, for example, the parent part of "/usr/lib" is "/usr", whose parent part is "/", which in turn has no parent. On Windows platforms, the parent part of "c:\java" is "c:\", which in turn has no parent.

Parameters:
child - The directory to get the parent of
See Also:
getPath, getCanonicalPath, separator
 o isDirectory
 public abstract boolean isDirectory(String dir)
Tests if the file represented by dir is a directory.

Parameters:
dir - The directory to test.
Returns:
true if the file exists and is a directory; false otherwise.
Throws: SecurityException
if a security manager exists, its checkRead method is called with the pathname of this File to see if the application is allowed read access to the file.
See Also:
getPath, checkRead
 o logEvent
 public abstract void logEvent(String message)
Logs an event to the install logfile for this installer

Parameters:
message - The message to log
 o getAbsolutePath
 public abstract String getAbsolutePath(String path)
Returns the absolute pathname of the file represented by the path. If the path represents an absolute pathname, then return the pathname. Otherwise, return a pathname that is a concatenation of the current user directory, the separator character, and the path passed in.

The system property user.dir contains the current user directory.

Parameters:
path - The path to get the absolute path of.
Returns:
a system-dependent absolute pathname for the path.
See Also:
getPath, isAbsolute, getProperty

All Packages  Class Hierarchy  This Package  Previous  Next  Index