boolean isSourceFolderEmpty(IContainer sourceFolder) { String sourceFolderName = sourceFolder.getProjectRelativePath().addTrailingSeparator().toString(); Object[] table = this.typeLocators.valueTable; for (int i = 0, l = table.length; i < l; i++) if (table[i] != null && ((String) table[i]).startsWith(sourceFolderName)) return false; return true; }
boolean isSourceFolderEmpty(IContainer sourceFolder) { String sourceFolderName = sourceFolder.getProjectRelativePath().addTrailingSeparator().toString(); Object[] table = this.typeLocators.valueTable; for (int i = 0, l = table.length; i < l; i++) if (table[i] != null && ((String) table[i]).startsWith(sourceFolderName)) return false; return true; }
boolean isSourceFolderEmpty(IContainer sourceFolder) { String sourceFolderName = sourceFolder.getProjectRelativePath().addTrailingSeparator().toString(); Object[] table = this.typeLocators.valueTable; for (int i = 0, l = table.length; i < l; i++) if (table[i] != null && ((String) table[i]).startsWith(sourceFolderName)) return false; return true; }
boolean isSourceFolderEmpty(IContainer sourceFolder) { String sourceFolderName = sourceFolder.getProjectRelativePath().addTrailingSeparator().toString(); Object[] table = this.typeLocators.valueTable; for (int i = 0, l = table.length; i < l; i++) if (table[i] != null && ((String) table[i]).startsWith(sourceFolderName)) return false; return true; }
boolean isSourceFolderEmpty(IContainer sourceFolder) { String sourceFolderName = sourceFolder.getProjectRelativePath().addTrailingSeparator().toString(); Object[] table = this.typeLocators.valueTable; for (int i = 0, l = table.length; i < l; i++) if (table[i] != null && ((String) table[i]).startsWith(sourceFolderName)) return false; return true; }
/** * Returns the parent folder of the given path. */ public static IPath getParentFolderPath(String contentFilePath) { IPath path = new Path(contentFilePath); path = path.removeLastSegments(1).addTrailingSeparator(); return path; }
public static String makeAbsolute(String original, String rootPath) { IPath path = new Path(original); // ensure we have a relative path to start with if (path.isAbsolute()) return original; IPath root = new Path(rootPath); return root.addTrailingSeparator().append(original.replace(':', '}')).toOSString().replace('}', ':'); }
public static String makeAbsolute(String original, String rootPath) { IPath path = new Path(original); // ensure we have a relative path to start with if (path.isAbsolute()) return original; IPath root = new Path(rootPath); return root.addTrailingSeparator().append(original.replace(':', '}')).toOSString().replace('}', ':'); }
public String getInstallLocation() { if ((_fInstallLocation == null) && (_fUnderlyingResource != null)) { IProject project = _fUnderlyingResource.getProject(); IPath path = project.getLocation(); if (path != null) { path = path.addTrailingSeparator(); return path.toString(); } return null; } return _fInstallLocation; }
public String getInstallLocation() { if (fInstallLocation == null && fUnderlyingResource != null) { IPath path = fUnderlyingResource.getProject().getLocation(); return path != null ? path.addTrailingSeparator().toString() : null; } return fInstallLocation; }
public static String makeAbsolute(String original, String rootPath) { IPath path = new Path(original); // ensure we have a relative path to start with if (path.isAbsolute()) return original; IPath root = new Path(rootPath); return root.addTrailingSeparator().append(original.replace(':', '}')).toOSString().replace('}', ':'); }
/** * 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(); }
@Override public String getInstallLocation() { // Ensure we have an underlying resource if (fUnderlyingResource == null) { return null; } IPath path = fUnderlyingResource.getLocation(); if (path == null) return null; return path.removeLastSegments(2).addTrailingSeparator().toOSString(); }
public String getInstallLocation() { // Ensure we have an underlying resource if (fUnderlyingResource == null) { return null; } IPath path = fUnderlyingResource.getLocation(); if(path == null) return null; return path.removeLastSegments(2).addTrailingSeparator().toOSString(); }
public String getInstallLocation() { IPath path = fUnderlyingResource.getLocation(); return path == null ? null : path.removeLastSegments(1).addTrailingSeparator().toOSString(); }
private static boolean addToExclusions(IPath entryPath, CPListElement curr) { IPath[] exclusionFilters= (IPath[]) curr.getAttribute(CPListElement.EXCLUSION); if (!JavaModelUtil.isExcludedPath(entryPath, exclusionFilters)) { IPath pathToExclude= entryPath.removeFirstSegments(curr.getPath().segmentCount()).addTrailingSeparator(); IPath[] newExclusionFilters= new IPath[exclusionFilters.length + 1]; System.arraycopy(exclusionFilters, 0, newExclusionFilters, 0, exclusionFilters.length); newExclusionFilters[exclusionFilters.length]= pathToExclude; curr.setAttribute(CPListElement.EXCLUSION, newExclusionFilters); return true; } return false; }
private static boolean addToExclusions(IPath entryPath, CPListElement curr) { IPath[] exclusionFilters= (IPath[]) curr.getAttribute(CPListElement.EXCLUSION); if (!JavaModelUtil.isExcludedPath(entryPath, exclusionFilters)) { IPath pathToExclude= entryPath.removeFirstSegments(curr.getPath().segmentCount()).addTrailingSeparator(); IPath[] newExclusionFilters= new IPath[exclusionFilters.length + 1]; System.arraycopy(exclusionFilters, 0, newExclusionFilters, 0, exclusionFilters.length); newExclusionFilters[exclusionFilters.length]= pathToExclude; curr.setAttribute(CPListElement.EXCLUSION, newExclusionFilters); return true; } return false; }
private static boolean addToExclusions(IPath entryPath, CPListElement curr) { IPath[] exclusionFilters= (IPath[]) curr.getAttribute(CPListElement.EXCLUSION); if (!JavaModelUtil.isExcludedPath(entryPath, exclusionFilters)) { IPath pathToExclude= entryPath.removeFirstSegments(curr.getPath().segmentCount()).addTrailingSeparator(); IPath[] newExclusionFilters= new IPath[exclusionFilters.length + 1]; System.arraycopy(exclusionFilters, 0, newExclusionFilters, 0, exclusionFilters.length); newExclusionFilters[exclusionFilters.length]= pathToExclude; curr.setAttribute(CPListElement.EXCLUSION, newExclusionFilters); return true; } return false; }
/** * Constructor */ private ApiBaselineManager(boolean framework) { if (framework) { ApiPlugin.getDefault().addSaveParticipant(this); savelocation = ApiPlugin.getDefault().getStateLocation().append(".api_profiles").addTrailingSeparator(); //$NON-NLS-1$ } }
protected URI computeTraceURI(URI uri, IJavaProject javaProject) throws JavaModelException { for (IPackageFragmentRoot root : javaProject.getPackageFragmentRoots()) if (root.getKind() == IPackageFragmentRoot.K_SOURCE) { URI prefix = URI.createPlatformResourceURI(root.getResource().getFullPath().addTrailingSeparator().toString(), true); if (isPrefix(prefix, uri)) return uri.deresolve(prefix).trimFragment().trimQuery(); } return super.getURIForTrace(uri); } }