@Override public IPath makeRelative() { if (!isAbsolute()) { return this; } return new Path(device, segments, flags & (HAS_TRAILING | IS_FOR_WINDOWS)); }
public IPath makeRelative() { if (!isAbsolute()) { return this; } return new Path(device, segments, separators & HAS_TRAILING); }
public IPath makeRelative() { if (!isAbsolute()) { return this; } return new Path(device, segments, separators & HAS_TRAILING); }
@Override public IPath makeRelative() { if (!isAbsolute()) { return this; } return new Path(device, segments, flags & (HAS_TRAILING | IS_FOR_WINDOWS)); }
private IClasspathEntry createLibraryEntry(IPath sourcePath, IPath rootPath, String path) { Path p = new Path(path); if (!p.isAbsolute()) { fInvalidPath = p; return null; //abort("There was a problem with path \" " + path + "\": paths must be absolute.", null); } return JavaCore.newLibraryEntry(p, sourcePath, rootPath); }
private IClasspathEntry createLibraryEntry(IPath sourcePath, IPath rootPath, String path) { Path p = new Path(path); if (!p.isAbsolute()) { fInvalidPath = p; return null; //abort("There was a problem with path \" " + path + "\": paths must be absolute.", null); } return JavaCore.newLibraryEntry(p, sourcePath, rootPath); }
private IPath getJarredPluginPath(Bundle bundle) { Path runtimeLibFullPath = null; String jarPluginLocation = bundle.getLocation().substring(7); Path jarPluginPath = new Path(jarPluginLocation); // handle case where jars are installed outside of eclipse installation if (jarPluginPath.isAbsolute()) runtimeLibFullPath = jarPluginPath; // handle normal case where all plugins under eclipse install else { String installPath = Platform.getInstallLocation().getURL().getPath(); runtimeLibFullPath = new Path(installPath+"/"+jarPluginLocation); //$NON-NLS-1$ } return runtimeLibFullPath; }
String path = properties.getProperty("path"); //$NON-NLS-1$ if (path != null) { if (!new Path(path).isAbsolute()) path = prefix + IPath.SEPARATOR + path; path += IPath.SEPARATOR + "eclipse" + IPath.SEPARATOR; //$NON-NLS-1$
String path = properties.getProperty("path"); //$NON-NLS-1$ if (path != null) { if (!new Path(path).isAbsolute()) path = prefix + IPath.SEPARATOR + path; path += IPath.SEPARATOR + "eclipse" + IPath.SEPARATOR; //$NON-NLS-1$
public IPath makeAbsolute() { if (isAbsolute()) { return this; } Path result = new Path(device, segments, separators | HAS_LEADING); //may need canonicalizing if it has leading ".." or "." segments if (result.segmentCount() > 0) { String first = result.segment(0); if (first.equals("..") || first.equals(".")) { //$NON-NLS-1$ //$NON-NLS-2$ result.canonicalize(); } } return result; }
public IPath makeAbsolute() { if (isAbsolute()) { return this; } Path result = new Path(device, segments, separators | HAS_LEADING); //may need canonicalizing if it has leading ".." or "." segments if (result.segmentCount() > 0) { String first = result.segment(0); if (first.equals("..") || first.equals(".")) { //$NON-NLS-1$ //$NON-NLS-2$ result.canonicalize(); } } return result; }
@Override public IPath makeAbsolute() { if (isAbsolute()) { return this; } Path result = new Path(device, segments, flags | HAS_LEADING); //may need canonicalizing if it has leading ".." or "." segments if (result.segmentCount() > 0) { String first = result.segment(0); if (first.equals("..") || first.equals(".")) { //$NON-NLS-1$ //$NON-NLS-2$ result.canonicalize(); } } return result; }
@Override public IPath makeAbsolute() { if (isAbsolute()) { return this; } Path result = new Path(device, segments, flags | HAS_LEADING); //may need canonicalizing if it has leading ".." or "." segments if (result.segmentCount() > 0) { String first = result.segment(0); if (first.equals("..") || first.equals(".")) { //$NON-NLS-1$ //$NON-NLS-2$ result.canonicalize(); } } return result; }
/** * Returns a File object representing the platform.xml or null if the file cannot be found. * @return File representing platform.xml or <code>null</code> */ private static File getPlatformFile(String platformHome) { String location = System.getProperty("org.eclipse.pde.platform_location"); //$NON-NLS-1$ File file = null; if (location != null) { try { IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager(); location = manager.performStringSubstitution(location); Path path = new Path(location); if (path.isAbsolute()) file = path.toFile(); else file = new File(platformHome, location); if (file.exists()) return file; } catch (CoreException e) { PDECore.log(e); } } file = new File(platformHome, "configuration/org.eclipse.update/platform.xml"); //$NON-NLS-1$ return file.exists() ? file : null; }
private IStatus validatePath() { StatusInfo status= new StatusInfo(); String val= fPathField.getText(); if (val.length() == 0) { return status; } Path path= new Path(val); if (path.isAbsolute()) { if (!path.toFile().isDirectory()) { status.setWarning(NewWizardMessages.NativeLibrariesDialog_error_external_not_existing); return status; } } else { if (!(ResourcesPlugin.getWorkspace().getRoot().findMember(path) instanceof IContainer)) { status.setWarning(NewWizardMessages.NativeLibrariesDialog_error_internal_not_existing); return status; } } return status; }
private IStatus validatePath() { StatusInfo status= new StatusInfo(); String val= fPathField.getText(); if (val.length() == 0) { return status; } Path path= new Path(val); if (path.isAbsolute()) { if (!path.toFile().isDirectory()) { status.setWarning(NewWizardMessages.NativeLibrariesDialog_error_external_not_existing); return status; } } else { if (!(ResourcesPlugin.getWorkspace().getRoot().findMember(path) instanceof IContainer)) { status.setWarning(NewWizardMessages.NativeLibrariesDialog_error_internal_not_existing); return status; } } return status; }
private IStatus validatePath() { StatusInfo status= new StatusInfo(); String val= fPathField.getText(); if (val.length() == 0) { return status; } Path path= new Path(val); if (path.isAbsolute()) { if (!path.toFile().isDirectory()) { status.setWarning(NewWizardMessages.NativeLibrariesDialog_error_external_not_existing); return status; } } else { if (!(ResourcesPlugin.getWorkspace().getRoot().findMember(path) instanceof IContainer)) { status.setWarning(NewWizardMessages.NativeLibrariesDialog_error_internal_not_existing); return status; } } return status; }
if (folderLocation.isAbsolute()) return new StatusInfo(IStatus.ERROR, NewWizardMessages.AddSourceFolderWizardPage_error_NotARelativePathName);
protected XMLStringBuffer createContentBuffer() { PreferenceStoreUtil storage = new PreferenceStoreUtil(TestNGPlugin.getDefault().getPreferenceStore()); String suiteTemplateFile = storage.getXmlTemplateFile(m_projectName, false /* not only project */); XMLStringBuffer suiteBuffer = new XMLStringBuffer(); //$NON-NLS-1$ suiteBuffer.setDocType("suite SYSTEM \"" + Parser.TESTNG_DTD_URL + "\""); if (!Utils.isStringEmpty(suiteTemplateFile)) { try { IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager(); String resolvedXmlFile = manager.performStringSubstitution(suiteTemplateFile); if (!(new Path(resolvedXmlFile).isAbsolute()) && !Utils.isStringEmpty(workingDir)) { resolvedXmlFile = workingDir + "/" + resolvedXmlFile; } createXmlFileFromTemplate(suiteBuffer, resolvedXmlFile); } catch (CoreException e) { throw new RuntimeException("Failed to create TestNG suite from \"Template XML File\" '" + suiteTemplateFile + "': " + e.getMessage(), e); } } else { createXmlFileFromParameters(suiteBuffer); } // Done with the top of the XML file, now generate the <test> elements initContentBuffer(suiteBuffer); suiteBuffer.pop("suite"); return suiteBuffer; }