All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.install.products.FileUnit
java.lang.Object
|
+----com.sun.install.products.InstallComponent
|
+----com.sun.install.products.InstallLeaf
|
+----com.sun.install.products.FileUnit
- public class FileUnit
- extends InstallLeaf
- implements ResourceResolver
The FileUnit is able to install files directly from the wizard
archive. FileUnit is also able to remove the files at uninstall
time, provided the files appear in the current directory.
-
resourceName
- The resource name is the key used on the archive to get a
stream containing files to be installed by this unit.
-
FileUnit()
- Create a FileUnit.
-
FileUnit(String)
- Create a FileUnit that reads from the specified resource
section in the archive.
-
FileUnit(String, String, String)
- Create a FileUnit that reads from the specified resource
section in the archive, which installs to the specified
relative path offset from the directory specified by the
installDirKey value.
-
addFile(String, String, Hashtable)
- Adds the specified file or directory to the resource.
-
addRuntimeResources(Vector)
- Add the runtime resources required by this class.
-
getCollection()
- Retrieves the vector of files this unit will write into the archive, along
with each file's attributes.
-
getComponentDescription()
- Gets the component's description.
-
getInstallLocation()
- Form the install location based on the installDirKey and a
possible relative path.
-
initialize(WizardState)
- Initialize the FileUnit by removing the alternate root.
-
install(WizardState)
- Install the files that are embedded in the wizard archive.
-
mkdirs(Vector, File)
- Recursively makes directories, registering each directory with the supplied vector so that it
gets removed at uninstall time.
-
readDestinationTable()
- sets the destination table that is used for disk space checking.
-
refresh(Vector, String)
-
Update this file.
-
resolveResource(String, String, byte[])
-
This method resolves the resources required by this FileUnit.
-
setFileTable(Vector)
- Sets the table of files to be written into the archive at buildtime.
-
toString()
- Represent this object as a string.
-
uninstall(WizardState)
- Uninstall this Leaf.
resourceName
protected String resourceName
- The resource name is the key used on the archive to get a
stream containing files to be installed by this unit.
FileUnit
public FileUnit()
- Create a FileUnit.
FileUnit
public FileUnit(String resourceName)
- Create a FileUnit that reads from the specified resource
section in the archive. The files will be installed and
removed from the directory chosen by the user.
- Parameters:
- resourceName - The name of the archive resource containing
files for this unit. Doubles as the name of
this component.
FileUnit
public FileUnit(String resourceName,
String installDirKey,
String relativePath)
- Create a FileUnit that reads from the specified resource
section in the archive, which installs to the specified
relative path offset from the directory specified by the
installDirKey value.
- Parameters:
- resourceName - The name of the archive resource containing
files for this unit.
- installDirKey - The WizardState key that references a String
object indicating where this FileUnit should be
installed. If this path is relative, the parent's
path is appended. Otherwise, it is not.
- relativePath - The relative path from the directory specified
by the DirectorySelectionPanel where this unit
will install its contents.
refresh
public boolean refresh(Vector targets,
String sharedPoolKey)
- Update this file. For the FileUnit, the files are read out of the
archive and their sizes updated against what is already installed. This
is a relatively expensive operation in terms of I/O requirements.
- Parameters:
- targets - The target properties (set via
setProperty()) to update.
- sharedPoolKey - the key to use during shared pooling.
- Returns:
-
true if the refresh was sucessful, falseotherwise.
- Overrides:
- refresh in class InstallComponent
initialize
public boolean initialize(WizardState state)
- Initialize the FileUnit by removing the alternate root.
- Parameters:
- state - The WizardState.
- Returns:
- true if the initialization was successful; false otherwise.
- Overrides:
- initialize in class InstallComponent
getInstallLocation
public String getInstallLocation()
- Form the install location based on the installDirKey and a
possible relative path. Althernate root is not considered in this method.
- Returns:
- The location this FileUnit will install to
- Overrides:
- getInstallLocation in class InstallComponent
readDestinationTable
public void readDestinationTable()
- sets the destination table that is used for disk space checking.
called by refresh() with a rule of "destinationTable"
getCollection
public ResourceCollection getCollection()
- Retrieves the vector of files this unit will write into the archive, along
with each file's attributes.
- Returns:
- The data table representing the files this FileUnit will
write into the archive
getComponentDescription
public ComponentDescription getComponentDescription()
- Gets the component's description.
- Returns:
- The ComponentDescription object associated with this FileUnit.
- Overrides:
- getComponentDescription in class InstallComponent
setFileTable
public boolean setFileTable(Vector fileTable)
- Sets the table of files to be written into the archive at buildtime.
The passed-in table is checked for sanity and is discarded in the event
the table is not in the correct form.
- Parameters:
- fileTable - the filetable to set into this FileUnit.
- Returns:
- true if the fileTable was sucessfully checked and set into this
fileleaf. false otherwise.
install
public boolean install(WizardState state)
- Install the files that are embedded in the wizard archive.
- Parameters:
- state - The wizard state.
- Returns:
- Whether the install was successful or not.
- Overrides:
- install in class InstallComponent
mkdirs
public static void mkdirs(Vector result,
File directory)
- Recursively makes directories, registering each directory with the supplied vector so that it
gets removed at uninstall time.
- Parameters:
- result - The vector to add the created directories to. The directories are inserted
at the beginning of the vector as they are made.
- directory - The desired directory to be made.
uninstall
public boolean uninstall(WizardState state)
- Uninstall this Leaf. This is run by the uninstaller at uninstall
time and has no information about where the install actually took
place. Hence, it must guess the install directory. The only guess
is the directory specified at buildtime (the default install directory)
- Parameters:
- state - The WizardState.
- Returns:
- Whether the uninstall was sucessful or not.
- Overrides:
- uninstall in class InstallComponent
addFile
public void addFile(String path,
String fileName,
Hashtable forcedPermissions)
- Adds the specified file or directory to the resource.
- Parameters:
- path - The path to the desired file to be added.
The
pathargument will not be remembered.
- filename - The name of the desired file/directory to be added.
If filename is a directory, this method will recursively
add all files in that directory,
and the files will be laid down in the same relative directories
as when collected.
- forcedPermissions - A hashtable consisting of filenames and
the desired permissions or
null if no forced
permissions should be appliet.. These permissions will
override any other permissions for this file at
install-time. The filenames should be specified relative
the the supplied path parameter.
resolveResource
public ResourceInputStream resolveResource(String type,
String name,
byte extData[])
- This method resolves the resources required by this FileUnit.
It either generates a stream for the list of names for the
"names" resource entry, or a stream for the actual contents of
this file unit.
- Parameters:
- type - The type of resource to resolve. This can be
"Class", "Image", "Audio" or any other description.
- name - The name of the resource to resolve.
- extData - Extra data to be associated with the resource. For
FileUnit, the extra data contains the file permissions.
toString
public String toString()
- Represent this object as a string.
- Returns:
- A description of this object.
- Overrides:
- toString in class InstallComponent
addRuntimeResources
public void addRuntimeResources(Vector resourceVector)
- Add the runtime resources required by this class.
- Parameters:
- resourceVector - The vector containing all of the required resources
for this class
- Overrides:
- addRuntimeResources in class InstallLeaf
All Packages Class Hierarchy This Package Previous Next Index