|
||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Class Summary | |
---|---|
AbstractFileAction | Common part between DirAction and FileAction , which stems from the fact
that they both involve in an object in a directory that has the same set of metadata. |
Action | An Action is the base class for all actions that are contained within
packages. |
DependAction | A DependAction is an action that represents a dependency from
one package to another. |
DirAction | A DirAction is an action that represents a directory within the
image. |
FileAction | A FileAction is an action that represents a file within the
image. |
Fmri | An Fmri is an identifier for a package. |
Image | An Image is a directory tree containing the laid-down contents
of a self-consistent graph of Packages. |
Image.FmriState | An FmriState represents the current state of an Fmri within
the image. |
ImagePlanProgressTracker | Callback handler for Image.ImagePlan.execute() to monitor the progress
of package add/remove/update operations. |
LicenseAction | A LicenseAction is a file action that represents a license file
within the image. |
LinkAction | A LinkAction is an action that represents a symbolic link within
the image. |
Manifest | A Manifest is a list of actions within a package. |
SetAction | A SetAction is an action that represents package attribute. |
SystemInfo | SystemInfo provides access to system information related to the
pkg(5) Java API. |
Variant | |
Version | A Version represents the version part of an IPS package FMRI. |
Version.DotSequence | The DotSequence class represents the x.y.z parts of a Version object. |
Enum Summary | |
---|---|
DependAction.Type | Type of dependency. |
SystemInfo.UpdateCheckFrequency |
Provides for client-side access to the Image Packaging System (IPS)
for Java clients.
The primary class for using this API is the Image
class.
File dir = new File(System.getProperty("user.home"), "bar"); Image img = new Image(dir); String pkgs[] = {"foo"}; img.installPackages(pkgs);
Listlist = img.getInventory(pkgs, false); if (list.size() > 0) { System.out.println("package foo is installed"); }
Listlist2 = img.getInventory(null, false); ArrayList pkgs2 = new ArrayList (); for (Image.FmriState fs : list2) { if (fs.upgradable) { pkgs2.add(fs.fmri.getName()); } } img.installPackages(pkgs2.toArray(new String[0]));
File dir = new File(System.getProperty("user.home"), "bar"); Image img = new Image(dir); String pkgs[] = {"foo"}; Image.ImagePlan ip = img.makeInstallPlan(pkgs); StringBuffer licenseText = new StringBuffer(); for (Fmri f : ip.getProposedFmris()) { Manifest m = img.getManifest(f); List<LicenseAction> lla = m.getActionsByType(LicenseAction.class); for (LicenseAction la : lla) { licenseText.append("===== ").append(la.getName()).append(" =====\n"); licenseText.append("\n"); licenseText.append(lla.getText()); licenseText.append("\n\n"); } } System.out.println(licenseText); ip.execute();
Logger cl = Logger.getLogger("com.sun.pkg.client"); cl.setLevel(Level.FINER);
|
||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |