@Override public String apply(IPath path) { return path.toPortableString(); } });
@Override public String apply(IPath linkedResource) { return linkedResource.toPortableString(); } });
public static String toPortableString(IPath path) { if (path == null) { return ""; } return path.toPortableString(); }
public static String getWorkspaceInvisibleProjectName(IPath workspacePath) { String fileName = workspacePath.toFile().getName(); String projectName = fileName + "_" + Integer.toHexString(workspacePath.toPortableString().hashCode()); return projectName; }
boolean areFixed(IResource[] res) { for (int i = 0; i < res.length; i++) { String fullPath = res[i].getFullPath().toPortableString(); if (!fFixedResources.containsKey(fullPath)) return false; } return true; }
private void xmlWriteJarLocation(JarPackageData jarPackage, Document document, Element xmlJarDesc) throws DOMException { Element jar= document.createElement(JarPackagerUtil.JAR_EXTENSION); xmlJarDesc.appendChild(jar); jar.setAttribute("path", jarPackage.getJarLocation().toPortableString()); //$NON-NLS-1$ }
private void savePath(IPath path) throws IOException { if (path == null) { this.out.writeBoolean(true); } else { this.out.writeBoolean(false); saveString(path.toPortableString()); } }
private void xmlWriteJarLocation(JarPackageData jarPackage, Document document, Element xmlJarDesc) throws DOMException { Element jar= document.createElement(JarPackagerUtil.JAR_EXTENSION); xmlJarDesc.appendChild(jar); jar.setAttribute("path", jarPackage.getJarLocation().toPortableString()); //$NON-NLS-1$ }
private void savePath(IPath path) throws IOException { if (path == null) { this.out.writeBoolean(true); } else { this.out.writeBoolean(false); saveString(path.toPortableString()); } }
private String relativePath(IPath path) { return path.removeFirstSegments(1).toPortableString(); } }
static private IPath convertToProperCase(IPath path) { if (Platform.getOS().equals(Platform.OS_WIN32)) return Path.fromPortableString(path.toPortableString().toLowerCase()); return path; }
static private IPath convertToProperCase(IPath path) { if (Platform.getOS().equals(Platform.OS_WIN32)) return Path.fromPortableString(path.toPortableString().toLowerCase()); return path; }
private String makeAbsolute(String input, ILaunchConfiguration configuration) throws CoreException { IResource member = ResourcesPlugin.getWorkspace().getRoot().findMember(input); if (member != null) { return member.getLocation().toPortableString(); } return input; }
public void setLinkLocation(IPath location, int updateFlags, IProgressMonitor monitor) throws CoreException { if (location.isAbsolute()) { setLinkLocation(URIUtil.toURI(location.toPortableString()), updateFlags, monitor); } else { try { setLinkLocation(new URI(null, null, location.toPortableString(), null), updateFlags, monitor); } catch (URISyntaxException e) { setLinkLocation(URIUtil.toURI(location.toPortableString()), updateFlags, monitor); } } } }
private static String encodePath(IPath path) { if (path == null) { return "#"; //$NON-NLS-1$ } else if (path.isEmpty()) { return "&"; //$NON-NLS-1$ } else { return encode(path.toPortableString()); } }
@Override public StandardSREInstall clone() { final StandardSREInstall clone = (StandardSREInstall) super.clone(); clone.jarFile = this.jarFile == null ? null : Path.fromPortableString(clone.jarFile.toPortableString()); return clone; }
private static String encodePath(IPath path) { if (path == null) { return "#"; //$NON-NLS-1$ } else if (path.isEmpty()) { return "&"; //$NON-NLS-1$ } else { return encode(path.toPortableString()); } }
private static String encodePath(IPath path) { if (path == null) { return "#"; //$NON-NLS-1$ } else if (path.isEmpty()) { return "&"; //$NON-NLS-1$ } else { return encode(path.toPortableString()); } }
URI toURI(IPath path) { if (path.isAbsolute()) return org.eclipse.core.filesystem.URIUtil.toURI(path); try { return new URI(null, null, path.toPortableString(), null); } catch (URISyntaxException e) { return org.eclipse.core.filesystem.URIUtil.toURI(path); } }
@Override public IClasspathAttribute performEdit(Shell shell, ClasspathAttributeAccess attribute) { String initialLocation= attribute.getClasspathAttribute().getValue(); IPath locationPath= initialLocation == null ? null : new Path(initialLocation); IPath newPath= BuildPathDialogAccess.configureExternalAnnotationsAttachment(shell, locationPath); if(null == newPath) // Was the dialog cancelled? return null; return JavaCore.newClasspathAttribute(IClasspathAttribute.EXTERNAL_ANNOTATION_PATH, newPath.segmentCount() == 0 ? null : newPath.toPortableString()); }