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.
-
DIRECTORIES
- Inficates to getList() what type of files to return.
-
FILES
- Inficates to getList() what type of files to return.
-
HOME_DIR
- Constant used with getNamedDirectory to return the
directory for home files.
-
INSTALL_DIR
- Constant used with getNamedDirectory to return the root
directory for program files on the system.
-
LIB_DIR
- Constant used with getNamedDirectory to return the
directory for library files on the system.
-
LOG_DIR
- Constant used with getNamedDirectory to return the
directory for writing log file.
-
TEMP_DIR
- Constant used with getNamedDirectory to return the
directory for writing temporary files.
-
canRead(String)
- Tests if the application can read from the specified file.
-
createDirectory(String)
- Creates a directory whose pathname is specified by dir.
-
fileExists(String)
- Tests if file exists.
-
getAbsolutePath(String)
- Returns the absolute pathname of the file represented by the
path.
-
getList(int, String)
- Gets a list of files in the supplied directory.
-
getNamedDirectory(String)
- Returns the directory for the specified type.
-
getParent(String)
- Returns the parent part of the pathname of this
File
object, or null if the name has no parent part.
-
getParentDirectory(String)
- Gets the parent directory of the supplied directory.
Deprecated.
-
getSeparator()
- Gets the system-dependent file separator
-
isDirectory(String)
- Tests if the file represented by
dir
is a directory.
-
logEvent(String)
- Logs an event to the install logfile for this installer
FILES
public static final int FILES
- Inficates to getList() what type of files to return.
DIRECTORIES
public static final int DIRECTORIES
- Inficates to getList() what type of files to return.
INSTALL_DIR
public static final String INSTALL_DIR
- Constant used with getNamedDirectory to return the root
directory for program files on the system.
LIB_DIR
public static final String LIB_DIR
- Constant used with getNamedDirectory to return the
directory for library files on the system.
TEMP_DIR
public static final String TEMP_DIR
- Constant used with getNamedDirectory to return the
directory for writing temporary files.
LOG_DIR
public static final String LOG_DIR
- Constant used with getNamedDirectory to return the
directory for writing log file.
HOME_DIR
public static final String HOME_DIR
- Constant used with getNamedDirectory to return the
directory for home files.
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.
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.
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.
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
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
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.
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
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
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
logEvent
public abstract void logEvent(String message)
- Logs an event to the install logfile for this installer
- Parameters:
- message - The message to log
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