/** * Helper method - returns the {@link IResource} corresponding to the provided {@link IPath}, * or <code>null</code> if no such resource exists. */ public static IResource getWorkspaceTarget(IPath path) { if (path == null || path.getDevice() != null) return null; IWorkspace workspace = ResourcesPlugin.getWorkspace(); if (workspace == null) return null; return workspace.getRoot().findMember(path); }
private boolean isWorkspacePath(IPath path) { if (path == null || path.getDevice() != null) return false; IWorkspace workspace= ResourcesPlugin.getWorkspace(); if (workspace == null) return false; return workspace.getRoot().findMember(path) != null; }
/** * Helper method - returns the {@link IResource} corresponding to the provided {@link IPath}, * or <code>null</code> if no such resource exists. */ public static IResource getWorkspaceTarget(IPath path) { if (path == null || path.getDevice() != null) return null; IWorkspace workspace = ResourcesPlugin.getWorkspace(); if (workspace == null) return null; return workspace.getRoot().findMember(path); }
private boolean isWorkspacePath(IPath path) { if (path == null || path.getDevice() != null) return false; IWorkspace workspace= ResourcesPlugin.getWorkspace(); if (workspace == null) return false; return workspace.getRoot().findMember(path) != null; }
private boolean isWorkspacePath(IPath path) { if (path == null || path.getDevice() != null) return false; IWorkspace workspace= ResourcesPlugin.getWorkspace(); if (workspace == null) return false; return workspace.getRoot().findMember(path) != null; }
private boolean isWorkspacePath(IPath path) { if (path == null || path.getDevice() != null) return false; IWorkspace workspace= ResourcesPlugin.getWorkspace(); if (workspace == null) return false; return workspace.getRoot().findMember(path) != null; }
/** * Helper method - returns the {@link IResource} corresponding to the provided {@link IPath}, * or <code>null</code> if no such resource exists. */ public static IResource getWorkspaceTarget(IPath path) { if (path == null || path.getDevice() != null) return null; IWorkspace workspace = ResourcesPlugin.getWorkspace(); if (workspace == null) return null; return workspace.getRoot().findMember(path); }
/** * Helper method - returns the {@link IResource} corresponding to the provided {@link IPath}, * or <code>null</code> if no such resource exists. */ public static IResource getWorkspaceTarget(IPath path) { if (path == null || path.getDevice() != null) return null; IWorkspace workspace = ResourcesPlugin.getWorkspace(); if (workspace == null) return null; return workspace.getRoot().findMember(path); }
private IPath fixDevice(IPath path) { if (path != null && path.getDevice() != null) { return path.setDevice(path.getDevice().toUpperCase()); } if (Platform.OS_WIN32.equals(Platform.getOS()) && path != null && path.toString().startsWith("//")) { String server = path.segment(0); String pathStr = path.toString().replace(server, server.toUpperCase()); return new Path(pathStr); } return path; }
/** * Answer the directory name specified as being the import source. Note that if it ends with a * separator then the separator is first removed so that java treats it as a proper directory */ private String getSourceDirectoryName(String sourceName) { IPath result = new Path(sourceName.trim()); if (result.getDevice() != null && result.segmentCount() == 0) // something like "c:" result = result.addTrailingSeparator(); else result = result.removeTrailingSeparator(); return result.toOSString(); }
/** * @deprecated use {@link #resolveURI(URI)} instead. */ @Override @Deprecated public IPath resolvePath(IPath path) { if (path == null || path.segmentCount() == 0 || path.isAbsolute() || path.getDevice() != null) return path; URI value = resolveURI(URIUtil.toURI(path)); return value == null ? path : URIUtil.toPath(value); }
/** * @deprecated use {@link #resolveURI(URI)} instead. */ @Override @Deprecated public IPath resolvePath(IPath path) { if (path == null || path.segmentCount() == 0 || path.isAbsolute() || path.getDevice() != null) return path; URI value = resolveURI(URIUtil.toURI(path)); return value == null ? path : URIUtil.toPath(value); }
public void load(BundleDescription description, PDEState state) { IPath path = new Path(description.getLocation()); String device = path.getDevice(); if (device != null) path = path.setDevice(device.toUpperCase()); setInstallLocation(path.toOSString()); fLocalization = state.getBundleLocalization(description.getBundleId()); super.load(description, state); }
@Override public void load(BundleDescription description, PDEState state) { IPath path = new Path(description.getLocation()); String device = path.getDevice(); if (device != null) path = path.setDevice(device.toUpperCase()); setInstallLocation(path.toOSString()); fLocalization = state.getBundleLocalization(description.getBundleId()); super.load(description, state); }
/** * @see org.eclipse.core.resources.IPathVariableManager#resolvePath(IPath) */ @Deprecated @Override public IPath resolvePath(IPath path) { if (path == null || path.segmentCount() == 0 || path.isAbsolute() || path.getDevice() != null) return path; IPath value = getValue(path.segment(0)); return value == null ? path : value.append(path.removeFirstSegments(1)); }
/** * @see org.eclipse.core.resources.IPathVariableManager#resolvePath(IPath) */ @Deprecated @Override public IPath resolvePath(IPath path) { if (path == null || path.segmentCount() == 0 || path.isAbsolute() || path.getDevice() != null) return path; IPath value = getValue(path.segment(0)); return value == null ? path : value.append(path.removeFirstSegments(1)); }