@Override public URI toURI() { try { return new URI(EFS.SCHEME_NULL, null, path.isEmpty() ? "/" : path.toString(), null); //$NON-NLS-1$ } catch (URISyntaxException e) { //should never happen Policy.log(IStatus.ERROR, "Invalid URI", e); //$NON-NLS-1$ return null; } } }
@Override public URI toURI() { try { return new URI(EFS.SCHEME_NULL, null, path.isEmpty() ? "/" : path.toString(), null); //$NON-NLS-1$ } catch (URISyntaxException e) { //should never happen Policy.log(IStatus.ERROR, "Invalid URI", e); //$NON-NLS-1$ return null; } } }
/** * Return whether the given path has children in the tree * @param path * @return whether there are children for the given path */ public synchronized boolean hasChildren(IPath path) { if (path.isEmpty()) return !objects.isEmpty(); Node node = getNode(path); if (node == null) return false; return node.hasDescendants(); }
public String getVariable() { IPath path= getPath(); if (!path.isEmpty()) { return path.segment(0); } return null; }
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()); } }
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()); } }
public String getVariable() { IPath path= getPath(); if (!path.isEmpty()) { return path.segment(0); } return null; }
public String getVariable() { IPath path= getPath(); if (!path.isEmpty()) { return path.segment(0); } return null; }
/** * Returns a workspace path to this resource if possible and the absolute filesystem location if not. */ public IPath getPath() { IPath workspacePath = getFirstWorkspaceLocation(); if (workspacePath.isEmpty()) { return new Path(getLocation().getString()); } return workspacePath; }
ClasspathDirectory(IContainer binaryFolder, boolean isOutputFolder, AccessRuleSet accessRuleSet, IPath externalAnnotationPath, boolean isOnModulePath) { this.binaryFolder = binaryFolder; this.isOutputFolder = isOutputFolder || binaryFolder.getProjectRelativePath().isEmpty(); // if binaryFolder == project, then treat it as an outputFolder this.directoryCache = new SimpleLookupTable(5); this.accessRuleSet = accessRuleSet; if (externalAnnotationPath != null) this.externalAnnotationPath = externalAnnotationPath.toOSString(); this.isOnModulePath = isOnModulePath; }
ClasspathDirectory(IContainer binaryFolder, boolean isOutputFolder, AccessRuleSet accessRuleSet, IPath externalAnnotationPath, boolean isOnModulePath) { this.binaryFolder = binaryFolder; this.isOutputFolder = isOutputFolder || binaryFolder.getProjectRelativePath().isEmpty(); // if binaryFolder == project, then treat it as an outputFolder this.directoryCache = new SimpleLookupTable(5); this.accessRuleSet = accessRuleSet; if (externalAnnotationPath != null) this.externalAnnotationPath = externalAnnotationPath.toOSString(); this.isOnModulePath = isOnModulePath; }
@Override public void setExternalAnnotationsPath(IPath path) { if (path != null && path.isEmpty()) { path = null; } updateClasspathEntry(getPath(), getSourceAttachmentPath(), getSourceAttachmentRootPath(), path); }
@Override public void setSourceAttachmentRootPath(IPath path) { if (path != null && path.isEmpty()) { path = null; } updateClasspathEntry(getPath(), getSourceAttachmentPath(), path, getExternalAnnotationsPath()); }
/** * @see IRuntimeClasspathEntry#setSourceAttachmentPath(IPath) */ @Override public void setSourceAttachmentPath(IPath path) { if (path != null && path.isEmpty()) { path = null; } updateClasspathEntry(getPath(), path, getSourceAttachmentRootPath(), getExternalAnnotationsPath()); }
/** * @see IRuntimeClasspathEntry#setSourceAttachmentPath(IPath) */ @Override public void setSourceAttachmentPath(IPath path) { if (path != null && path.isEmpty()) { path = null; } updateClasspathEntry(getPath(), path, getSourceAttachmentRootPath(), getExternalAnnotationsPath()); }
protected IContainer createFolder(IPath packagePath, IContainer outputFolder) throws CoreException { if (packagePath.isEmpty()) return outputFolder; IFolder folder = outputFolder.getFolder(packagePath); if (!folder.exists()) { createFolder(packagePath.removeLastSegments(1), outputFolder); folder.create(IResource.FORCE | IResource.DERIVED, true, null); } return folder; }
protected IContainer createFolder(IPath packagePath, IContainer outputFolder) throws CoreException { if (packagePath.isEmpty()) return outputFolder; IFolder folder = outputFolder.getFolder(packagePath); if (!folder.exists()) { createFolder(packagePath.removeLastSegments(1), outputFolder); folder.create(IResource.FORCE | IResource.DERIVED, true, null); } return folder; }
protected IContainer createFolder(IPath packagePath, IContainer outputFolder) throws CoreException { if (packagePath.isEmpty()) return outputFolder; IFolder folder = outputFolder.getFolder(packagePath); if (!folder.exists()) { createFolder(packagePath.removeLastSegments(1), outputFolder); folder.create(IResource.FORCE | IResource.DERIVED, true, null); } return folder; }
protected IContainer createFolder(IPath packagePath, IContainer outputFolder) throws CoreException { if (packagePath.isEmpty()) return outputFolder; IFolder folder = outputFolder.getFolder(packagePath); if (!folder.exists()) { createFolder(packagePath.removeLastSegments(1), outputFolder); folder.create(IResource.FORCE | IResource.DERIVED, true, null); } return folder; }