本文整理汇总了Java中org.netbeans.installer.product.Registry.loadProductRegistry方法的典型用法代码示例。如果您正苦于以下问题:Java Registry.loadProductRegistry方法的具体用法?Java Registry.loadProductRegistry怎么用?Java Registry.loadProductRegistry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.netbeans.installer.product.Registry
的用法示例。
在下文中一共展示了Registry.loadProductRegistry方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadRegistry
import org.netbeans.installer.product.Registry; //导入方法依赖的package包/类
private Registry loadRegistry(
final File root,
final File tempUserDir,
final Platform platform) throws ManagerException {
try {
final File registryXml =
new File(root, REGISTRY_XML);
final Registry registry = new Registry();
registry.setLocalDirectory(tempUserDir);
registry.setFinishHandler(DummyFinishHandler.INSTANCE);
registry.setTargetPlatform(platform);
registry.loadProductRegistry(registryXml);
return registry;
} catch (InitializationException e) {
throw new ManagerException(e);
}
}
示例2: getJavaBundledAndInstalled
import org.netbeans.installer.product.Registry; //导入方法依赖的package包/类
private File getJavaBundledAndInstalled() {
try {
Registry bundledRegistry = new Registry();
final String bundledRegistryUri = System.getProperty(
Registry.BUNDLED_PRODUCT_REGISTRY_URI_PROPERTY);
bundledRegistry.loadProductRegistry(
(bundledRegistryUri != null) ? bundledRegistryUri : Registry.DEFAULT_BUNDLED_PRODUCT_REGISTRY_URI);
// iterate over bundled JDKs to check whether they are already installed
for (Product bundledJdk : bundledRegistry.getProducts(JDK_PRODUCT_UID)) {
Product globalJdk = Registry.getInstance().getProduct(
JDK_PRODUCT_UID,
bundledJdk.getVersion());
if (globalJdk != null) {
final File jdkLoc = globalJdk.getStatus().equals(Status.INSTALLED) ? globalJdk.getInstallationLocation() : JavaUtils.findJDKHome(globalJdk.getVersion());
if (jdkLoc != null && jdkLocations.contains(jdkLoc)) {
return jdkLoc;
}
}
}
} catch (InitializationException e) {
LogManager.log("Cannot load bundled registry", e);
}
return null;
}
示例3: loadRegistry
import org.netbeans.installer.product.Registry; //导入方法依赖的package包/类
public Registry loadRegistry(String... registryNames) throws ManagerException {
if (registryNames.length > 0) {
List<File> files = new LinkedList<File>();
for (String name: registryNames) {
if (registries.get(name) == null) {
addRegistry(name);
}
files.add(new File(registries.get(name), REGISTRY_XML));
}
try {
final Registry registry = new Registry();
registry.setLocalDirectory(NBI);
registry.setFinishHandler(new DummyFinishHandler());
for (File file: files) {
registry.loadProductRegistry(file);
}
return registry;
} catch (InitializationException e) {
e.printStackTrace();
throw new ManagerException("Could not load registry", e);
}
}
return null;
}
示例4: getProducts
import org.netbeans.installer.product.Registry; //导入方法依赖的package包/类
public List<Product> getProducts(String... registryNames) throws ManagerException {
List<Product> components = new LinkedList<Product>();
if (registryNames.length > 0) {
final List<File> files = new LinkedList<File>();
for (String registryName: registryNames) {
if (registries.get(registryName) == null) {
addRegistry(registryName);
}
files.add(new File(registries.get(registryName), REGISTRY_XML));
}
try {
final Registry registry = new Registry();
registry.setLocalDirectory(NBI);
registry.setFinishHandler(new DummyFinishHandler());
for (File file: files) {
registry.loadProductRegistry(file);
}
components.addAll(registry.getProducts());
} catch (InitializationException e) {
e.printStackTrace();
throw new ManagerException("Could not load registry", e);
}
}
return components;
}
示例5: generateBundles
import org.netbeans.installer.product.Registry; //导入方法依赖的package包/类
public void generateBundles(String[] registryNames) throws ManagerException {
try {
final List<File> files = new ArrayList<File>();
for (String name: registryNames) {
if (registries.get(name) == null) {
addRegistry(name);
}
files.add(new File(registries.get(name), REGISTRY_XML));
}
for (Platform platform: Platform.values()) {
final Registry registry = new Registry();
registry.setLocalDirectory(NBI);
registry.setFinishHandler(new DummyFinishHandler());
for (File file: files) {
registry.loadProductRegistry(file);
}
final List<Product> products = registry.getProducts(platform);
for (int i = 1; i <= products.size(); i++) {
Product[] combination = new Product[i];
iterate(platform, registryNames, registry, combination, 0, products, 0);
}
}
} catch (InitializationException e) {
throw new ManagerException("Cannot generate bundles", e);
}
}
示例6: WelcomePanel
import org.netbeans.installer.product.Registry; //导入方法依赖的package包/类
public WelcomePanel() {
setProperty(TITLE_PROPERTY,
DEFAULT_TITLE);
setProperty(DESCRIPTION_PROPERTY,
DEFAULT_DESCRIPTION);
setProperty(WELCOME_TEXT_PROPERTY,
DEFAULT_WELCOME_TEXT);
setProperty(WELCOME_ALREADY_INSTALLED_TEXT_PROPERTY,
DEFAULT_WELCOME_ALREADY_INSTALLED_TEXT);
setProperty(WELCOME_ALREADY_INSTALLED_NEXT_BUTTON_TEXT_PROPERTY,
DEFAULT_WELCOME_ALREADY_INSTALLED_NEXT_BUTTON_TEXT);
try {
defaultRegistry = Registry.getInstance();
bundledRegistry = new Registry();
final String bundledRegistryUri = System.getProperty(
Registry.BUNDLED_PRODUCT_REGISTRY_URI_PROPERTY);
if (bundledRegistryUri != null) {
bundledRegistry.loadProductRegistry(bundledRegistryUri);
} else {
bundledRegistry.loadProductRegistry(
Registry.DEFAULT_BUNDLED_PRODUCT_REGISTRY_URI);
}
} catch (InitializationException e) {
ErrorManager.notifyError("Cannot load bundled registry", e);
}
}