All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.wizards.builder.NativeSupportResourceWriter

java.lang.Object
   |
   +----com.sun.wizards.builder.NativeSupportResourceWriter

public class NativeSupportResourceWriter
extends Object
implements ResourceResolver
This class can supply native resources for an archive. It can do so using an existing archive (for writing archives during the running of a wizard), or use the filesystem (used when building a wizard from a class repository from the local filesystem. For now, it plays a dual role of resource name collecting and resource resolving.


Constructor Index

 o NativeSupportResourceWriter(String)
Creates a NativeSupportResourceWriter that reads its native resources from the local filesystem.
 o NativeSupportResourceWriter(WizardState)
Used to resolve native resources out of an existing wizard archive that has supporting ArchiveReader and WizardStates already instantiated.

Method Index

 o addSection(ResourceCollection, String)
Iterates through each section in the "NativeSupport" indirect pointers
 o getArchivePlatforms()
Returns a Vector of Platform objects that describe the native platform support that will be included in this archive.
 o getArchs(int, int, File)
Loads the platforms variable with the native support found in the SDK.
 o getOsNames(int, File)
Loads the platforms variable with the native support found in the SDK.
 o getOsTypes(String)
Loads the platforms variable with the native support found in the SDK.
 o getResources()
Creates a ResourceCollection of resources to include in the archive.
 o getSupportedPlatforms()
Returns a Vector containing Platform objects which describe the platforms supported by this object.
 o resolveResource(String, String, byte[])
Gets the platform support data for each supported platformd.
 o setArchivePlatforms(Vector)
Sets the platform support which will be included in the archive.

Constructors

 o NativeSupportResourceWriter
 public NativeSupportResourceWriter(WizardState wizardState)
Used to resolve native resources out of an existing wizard archive that has supporting ArchiveReader and WizardStates already instantiated.

Parameters:
wizardState - The WizardState to use during resource resolution.
 o NativeSupportResourceWriter
 public NativeSupportResourceWriter(String classPath)
Creates a NativeSupportResourceWriter that reads its native resources from the local filesystem. Used when one is building a new wizard from a class repository.

Parameters:
classPath - The path to search for native resources (must be within a subdirectory called "native")

Methods

 o getSupportedPlatforms
 public Vector getSupportedPlatforms()
Returns a Vector containing Platform objects which describe the platforms supported by this object.

Returns:
a Vector containing Platform objects which describe the platforms supported by this object.
 o setArchivePlatforms
 public void setArchivePlatforms(Vector platforms)
Sets the platform support which will be included in the archive. Each platform specified must be supported by this object. To get a list of supported platforms, use getSupportedPlatforms first.

Parameters:
platforms - The list of platforms the resulting archive should support.
 o getArchivePlatforms
 public Vector getArchivePlatforms()
Returns a Vector of Platform objects that describe the native platform support that will be included in this archive.

Returns:
a Vector of Platform objects that describe the native platform support that will be included in this archive.
 o getOsTypes
 public void getOsTypes(String dirName)
Loads the platforms variable with the native support found in the SDK.

Parameters:
dirName - The directory in which the native support can be found.
 o getOsNames
 public void getOsNames(int osType,
                        File osTypeDir)
Loads the platforms variable with the native support found in the SDK.

Parameters:
osType - The os type to load. (i.e. Unix, Windows).
osTypeDir - The directory where the osType resides.
 o getArchs
 public void getArchs(int osType,
                      int osName,
                      File archDir)
Loads the platforms variable with the native support found in the SDK.

Parameters:
osType - The os type to load. (i.e. Unix, Windows).
osName - The os name to load. (i.e. Solaris, Windows 95).
archDir - The directory where the architecture support resides.
 o getResources
 public ResourceCollection getResources()
Creates a ResourceCollection of resources to include in the archive. Based on the support platforms. If a WizardState was specified in the constructor, then that wizard state is used to gather resources from the existing archive. Otherwise the filesystem is queried and all native resources for the desired platforms are included.

 o addSection
 public void addSection(ResourceCollection collection,
                        String sectionName)
Iterates through each section in the "NativeSupport" indirect pointers

Parameters:
collection - The collection of files to add to the specified section.
sectionName - The name of the section the specified collection should be written into.
 o resolveResource
 public ResourceInputStream resolveResource(String type,
                                            String name,
                                            byte extData[])
Gets the platform support data for each supported platformd. We should only be resolving resources for native support if they are the actual native binary files. The platform-specific java classes get resolved by a standard FileResolver.

Parameters:
type - The type of resource to resolve.
name - The name of the resource.
extData - The extra data to associate with the resource.
Returns:
The binary data for this file.

All Packages  Class Hierarchy  This Package  Previous  Next  Index