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.


Variable Index

 o ALL_LINES
Value passed to getTextFile(String, int) to indicate we would like all of the lines in the text file

Constructor Index

 o FileServerObject()
Create a new FileServerObject

Method Index

 o addRuntimeResources(Vector)
Get the runtime classes required by this ServerObject.
 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)
 o getParent(String)
Gets the parent directory of the supplied directory.
 o getParentDirectory(String)
Gets the parent directory of the supplied directory. Deprecated.
 o getSeparator()
Gets this systems separator.
 o getTextFile(String)
Gets a text file from the server, returns the entire file as a string.
 o getTextFile(String, int)
Gets a text file from the server, returns the entire file as a string, starting at the line number specified.
 o getTextFile(String, int, int)
Gets a text file from the server, returns the first numberOfLines of the file as a string.
 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
 o setWizardState(WizardState)
This method sets the WizardState into the object at runtime

Variables

 o 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

Constructors

 o FileServerObject
 public FileServerObject()
Create a new FileServerObject

Methods

 o setWizardState
 public void setWizardState(WizardState wizardState)
This method sets the WizardState into the object at runtime

Parameters:
wizardState - The WizardState parent.
 o addRuntimeResources
 public void addRuntimeResources(Vector resourceVector)
Get the runtime classes required by this ServerObject.

Parameters:
resourceVector - the vector to add the required resources to.
 o 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.
 o 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.
 o 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.
 o getSeparator
 public String getSeparator()
Gets this systems separator. Returns the contents of File.separator.

Returns:
The system-dependent file separator String.
 o 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.
 o 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.
 o 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.
 o 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
 o 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
 o 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
 o getNamedDirectory
 public String getNamedDirectory(String directoryName)
 o 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
 o 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
 o 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