All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.install.products.FileServerObject
java.lang.Object
|
+----com.sun.install.products.FileServerObject
- public class FileServerObject
- extends Object
- implements ServerObject, Serializable, FileBrowser
The FileServerObject is an object that is used to get text files
off of the server for GUI display.
-
ALL_LINES
- Value passed to getTextFile(String, int) to indicate we would like all
of the lines in the text file
-
FileServerObject()
- Create a new FileServerObject
-
addRuntimeResources(Vector)
- Get the runtime classes required by this ServerObject.
-
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)
-
-
getParent(String)
- Gets the parent directory of the supplied directory.
-
getParentDirectory(String)
- Gets the parent directory of the supplied directory.
Deprecated.
-
getSeparator()
- Gets this systems separator.
-
getTextFile(String)
- Gets a text file from the server, returns the entire file as a string.
-
getTextFile(String, int)
- Gets a text file from the server, returns the entire file as a string, starting at the line
number specified.
-
getTextFile(String, int, int)
-
Gets a text file from the server, returns the first
numberOfLines of the file as a string.
-
isDirectory(String)
- Tests if the file represented by
dir
is a directory.
-
logEvent(String)
- Logs an event to the install logfile for this installer
-
setWizardState(WizardState)
- This method sets the WizardState into the object at runtime
ALL_LINES
public static int ALL_LINES
- Value passed to getTextFile(String, int) to indicate we would like all
of the lines in the text file
FileServerObject
public FileServerObject()
- Create a new FileServerObject
setWizardState
public void setWizardState(WizardState wizardState)
- This method sets the WizardState into the object at runtime
- Parameters:
- wizardState - The WizardState parent.
addRuntimeResources
public void addRuntimeResources(Vector resourceVector)
- Get the runtime classes required by this ServerObject.
- Parameters:
- resourceVector - the vector to add the required resources to.
getTextFile
public String getTextFile(String fileName)
- Gets a text file from the server, returns the entire file as a string.
- Parameters:
- fileName - The filename of the file to retrieve
- Returns:
- The text file contents, or
null if the file is non-existant, non-readable,
or not a regular file.
getTextFile
public String getTextFile(String fileName,
int offset)
- Gets a text file from the server, returns the entire file as a string, starting at the line
number specified.
- Parameters:
- fileName - The filename of the file to retrieve
- offset - The number of lines at the beginning of the file to skip.
- Returns:
- The text file contents, or
null if the file is non-existant, non-readable,
or not a regular file.
getTextFile
public String getTextFile(String fileName,
int offset,
int numberOfLines)
- Gets a text file from the server, returns the first
numberOfLines of the file as a string.
- Parameters:
- fileName - The filename of the file to retrieve. This is assumed to be in the
correct form for the server platform. This implies that the filename was generated
by the server.
- offset - The number of lines at the beginning of the file to skip.
- numberOfLines - The number of lines of the file to retrieve
- Returns:
- The text file contents, or
null if the file is non-existant, non-readable,
or not a regular file. If the number of lines to skip plus the number of lines
to read is greater than the number of lines in the file, only the available number of lines
will be returned. If the number of lines to skip is greater than the number of lines in the
in the file, returns null.
getSeparator
public String getSeparator()
- Gets this systems separator. Returns the contents of
File.separator.
- Returns:
- The system-dependent file separator String.
getList
public String[] getList(int type,
String dir)
- Gets a list of files in the supplied directory.
- Parameters:
- type - The type of entries to return in the list.
- dir - 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.
getParentDirectory
public String getParentDirectory(String dir)
- Note: getParentDirectory() is deprecated.
use
getParent(String).
- Gets the parent directory of the supplied directory.
- Parameters:
- dir - 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.
getParent
public String getParent(String dir)
- Gets the parent directory of the supplied directory.
- Parameters:
- dir - 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.
getAbsolutePath
public String getAbsolutePath(String file)
- 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
fileExists
public 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 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 String getNamedDirectory(String directoryName)
canRead
public 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
isDirectory
public 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 void logEvent(String message)
- Logs an event to the install logfile for this installer
- Parameters:
- message - The message to log
All Packages Class Hierarchy This Package Previous Next Index