public String getJavadocLocation(IPluginModelBase model) { File file = new File(model.getInstallLocation()); if (file.isDirectory()) { File doc = new File(file, "doc"); //$NON-NLS-1$ if (new File(doc, "package-list").exists()) //$NON-NLS-1$ return doc.getAbsolutePath(); } else if (CoreUtility.jarContainsResource(file, "doc/package-list", false)) { //$NON-NLS-1$ return file.getAbsolutePath() + "!/doc"; //$NON-NLS-1$ } return getEntry(model); }
private static URL getSchemaURL(IPluginModelBase model, String schema) { try { if (model == null) return null; String location = model.getInstallLocation(); if (location == null) return null; File file = new File(location); if (file.isDirectory()) { File schemaFile = new File(file, schema); if (schemaFile.exists()) return schemaFile.toURL(); } else if (CoreUtility.jarContainsResource(file, schema, false)) { //$NON-NLS-1$ return new URL("jar:file:" + file.getAbsolutePath() + "!/" + schema); //$NON-NLS-1$ //$NON-NLS-2$ } } catch (MalformedURLException e) { } return null; }
private static URL getSchemaURL(IPluginModelBase model, String schema) { try { if (model == null) return null; String location = model.getInstallLocation(); if (location == null) return null; File file = new File(location); if (file.isDirectory()) { File schemaFile = new File(file, schema); if (schemaFile.exists()) return schemaFile.toURL(); } else if (CoreUtility.jarContainsResource(file, schema, false)) { return new URL("jar:file:" + file.getAbsolutePath() + "!/" + schema); //$NON-NLS-1$ //$NON-NLS-2$ } } catch (MalformedURLException e) { } return null; }
public String getJavadocLocation(IPluginModelBase model) { try { File file = new File(model.getInstallLocation()); if (file.isDirectory()) { File doc = new File(file, "doc"); //$NON-NLS-1$ if (new File(doc, "package-list").exists()) //$NON-NLS-1$ return doc.toURL().toString(); } else if (CoreUtility.jarContainsResource(file, "doc/package-list", false)) { //$NON-NLS-1$ return "jar:" + file.toURL().toString() + "!/doc"; //$NON-NLS-1$ //$NON-NLS-2$ } return getEntry(model); } catch (MalformedURLException e) { PDECore.log(e); return null; } }
private static IPath getFullPath(IPath path, IProduct product) throws MalformedURLException { String filePath = path.toString(); IWorkspaceRoot root = PDEPlugin.getWorkspace().getRoot(); // look in root if (filePath.indexOf('/') == 0) { IResource resource = root.findMember(filePath); if (resource != null) return new Path("file:", resource.getLocation().toString()); //$NON-NLS-1$ throw new MalformedURLException(); } // look in project IProject project = product.getModel().getUnderlyingResource().getProject(); IResource resource = project.findMember(filePath); if (resource != null) return new Path("file:", resource.getLocation().toString()); //$NON-NLS-1$ // look in external models IPluginModelBase model = PluginRegistry.findModel(product.getDefiningPluginId()); if (model != null && model.getInstallLocation() != null) { File modelNode = new File(model.getInstallLocation()); String pluginPath = modelNode.getAbsolutePath(); if (modelNode.isFile() && CoreUtility.jarContainsResource(modelNode, filePath, false)) return new Path("jar:file:", pluginPath + "!/" + filePath); //$NON-NLS-1$ //$NON-NLS-2$ return new Path("file:", pluginPath + "/" + filePath); //$NON-NLS-1$ //$NON-NLS-2$ } // no file found - throw exception throw new MalformedURLException(); }
return true; } else { if (CoreUtility.jarContainsResource(new File(bundleJar), paths.get(i).toString(), false)) return true;
return true; } else { if (CoreUtility.jarContainsResource(new File(bundleJar), paths.get(i).toString(), false)) return true;
return new File(p.toOSString()).exists(); return CoreUtility.jarContainsResource(external, libname, false);
return new File(p.toOSString()).exists(); return CoreUtility.jarContainsResource(external, libname, false);
File file = new File(installLocation); if (file.isFile()) { if (CoreUtility.jarContainsResource(file, ICoreConstants.BUNDLE_FILENAME_DESCRIPTOR, false)) { filename = ICoreConstants.BUNDLE_FILENAME_DESCRIPTOR;