|
||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||
See:
Description
| Class Summary | |
|---|---|
| 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. |
| LicenseAction | A LicenseAction is a file action that represents a license file
within the image. |
| Manifest | A Manifest is a list of actions within a package. |
| SystemInfo | SystemInfo provides access to system information related to the
pkg(5) Java API. |
| 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 | |
|---|---|
| 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);
List list = img.getInventory(pkgs, false);
if (list.size() > 0) {
System.out.println("package foo is installed");
}
List list2 = 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 | |||||||