public File findSourceFile(IPluginBase pluginBase, IPath sourcePath) { IPath relativePath = getRelativePath(pluginBase, sourcePath); SearchResult result = findSourceLocation(relativePath); return result != null ? result.file : null; }
public IPath findSourcePath(IPluginBase pluginBase, IPath sourcePath) { IPath relativePath = getRelativePath(pluginBase, sourcePath); SearchResult result = findSourceLocation(relativePath); return result == null ? null : result.loc.getPath().append(relativePath); }
return null; IPath relativePath = getRelativePath(pluginBase, filePath); IPath result = searchUserSpecifiedLocations(relativePath); if (result == null) {
/** * Searches source locations for one that provides source for the given pluginBase. * Will search user specified locations, then bundle manifest specified locations, then * extension point specified locations. If a bundle manifest location is found, the * location of the bundle jar will be returned. If the source is found at a user defined * or extension location, the archive file specified by the sourceLibraryPath will be * returned (after checking for existence). If the given sourceLibraryPath is <code>null</code> * the folder or jar for the found source location is returned. * @param pluginBase plugin that needs a source archive * @param sourceLibraryPath relative path to where the specific source library can be found within the source location or <code>null</code> * @return path to a source archive or <code>null</code> if a location could not be found */ public IPath findSourcePath(IPluginBase pluginBase, IPath sourceLibraryPath) { if (pluginBase.getId() == null || pluginBase.getVersion() == null) { return null; } IPath relativePath = getRelativePath(pluginBase, sourceLibraryPath); IPath result = searchUserSpecifiedLocations(relativePath); if (result == null) { result = searchBundleManifestLocations(pluginBase); if (result == null) { result = searchExtensionLocations(relativePath); } } return result; }