Tabnine Logo
IPath.toOSString
Code IndexAdd Tabnine to your IDE (free)

How to use
toOSString
method
in
org.eclipse.core.runtime.IPath

Best Java code snippets using org.eclipse.core.runtime.IPath.toOSString (Showing top 20 results out of 1,251)

origin: org.eclipse.core/runtime

  String msg = NLS.bind(PrefsMessages.preferences_fileNotFound, path.toOSString());
  throw new CoreException(new Status(IStatus.ERROR, PrefsMessages.OWNER_NAME, 1, msg, null));
  service.importPreferences(input);
} catch (FileNotFoundException e) {
  String msg = NLS.bind(PrefsMessages.preferences_fileNotFound, path.toOSString());
  throw new CoreException(new Status(IStatus.ERROR, PrefsMessages.OWNER_NAME, 1, msg, e));
} finally {
origin: io.sarl/io.sarl.eclipse

private static String toOSString(IPath path) {
  if (path == null) {
    return Utilities.EMPTY_STRING;
  }
  return path.toOSString();
}
origin: org.eclipse.platform/org.eclipse.core.resources

public void map(IPath file, IPath aLocation) {
  if (aLocation == null)
    table.remove(file);
  else
    table.setProperty(file.toOSString(), aLocation.toOSString());
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

/**
 *  Creates the specified file system directory at <code>destinationPath</code>.
 *  This creates a new file system directory.
 *
 *  @param destinationPath location to which files will be written
 */
public void createFolder(IPath destinationPath) {
  new File(destinationPath.toOSString()).mkdir();
}
origin: org.eclipse/org.eclipse.jdt.ui

private String flatPathList(IPath[] paths) {
  StringBuffer buf= new StringBuffer();
  for (int i= 0; i < paths.length; i++) {
    if (i > 0) {
      buf.append(File.pathSeparatorChar);
    }
    buf.append(paths[i].toOSString());
  }
  return buf.toString();
}

origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private String flatPathList(IPath[] paths) {
  StringBuffer buf= new StringBuffer();
  for (int i= 0; i < paths.length; i++) {
    if (i > 0) {
      buf.append(File.pathSeparatorChar);
    }
    buf.append(paths[i].toOSString());
  }
  return buf.toString();
}
origin: eclipse/eclipse.jdt.ls

  @Override
  public int compare(IProject p1, IProject p2) {
    return p2.getLocation().toOSString().length() - p1.getLocation().toOSString().length();
  }
}).collect(Collectors.toList());
origin: org.eclipse/org.eclipse.jdt.debug.ui

private void processLibraryLocation(LibraryLocation[] libLocations, String label) {
  for (int l= 0; l < libLocations.length; l++) {
    LibraryLocation location= libLocations[l];
    fLib2Name.put(location.getSystemLibraryPath().toOSString(), label);
  }
}
origin: org.eclipse.pde/org.eclipse.pde.ui

protected String getDestination() {
  if (fArchiveFileButton.getSelection()) {
    String path = fArchiveCombo.getText();
    if (path.length() > 0) {
      path = new Path(path).removeLastSegments(1).toOSString();
      return new File(path).getAbsolutePath();
    }
    return ""; //$NON-NLS-1$
  }
  File dir = new File(fDirectoryCombo.getText().trim());
  return dir.getAbsolutePath();
}
origin: org.eclipse.jdt/org.eclipse.jdt.core

private String getExternalAnnotationPath(IClasspathEntry entry) {
  if (entry == null)
    return null;
  IPath path = ClasspathEntry.getExternalAnnotationPath(entry, this.project.getProject(), true);
  if (path == null)
    return null;
  return path.toOSString();
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

private String getExternalAnnotationPath(IClasspathEntry entry) {
  if (entry == null)
    return null;
  IPath path = ClasspathEntry.getExternalAnnotationPath(entry, this.project.getProject(), true);
  if (path == null)
    return null;
  return path.toOSString();
}
origin: org.eclipse/org.eclipse.jst.j2ee

protected String getArchiveURI() {
  String archiveURI = null;
  VirtualArchiveComponent archiveComp = (VirtualArchiveComponent) getComponent();
  java.io.File diskFile = archiveComp.getUnderlyingDiskFile();
  if (diskFile.exists())
    archiveURI = diskFile.getAbsolutePath();
  else {
    IFile iFile = archiveComp.getUnderlyingWorkbenchFile();
    archiveURI = iFile.getRawLocation().toOSString();
  }
  return archiveURI;
}
origin: org.eclipse/org.eclipse.wst.common.frameworks

private String getDefaultLocation() {
  IPath path = getRootLocation();
  String projectName = (String) getProperty(PROJECT_NAME);
  if (projectName != null)
    path = path.append(projectName);
  return path.toOSString();
}
origin: org.eclipse/org.eclipse.jdt.ui

private String getDefaultAntPath(IJavaProject project) {
  if (project != null) {
    // The Javadoc.xml file can only be stored locally. So if
    // the project isn't local then we can't provide a good 
    // default location.
    IPath path= project.getProject().getLocation();
    if (path != null)
      return path.append("javadoc.xml").toOSString(); //$NON-NLS-1$
  }
  return ""; //$NON-NLS-1$
}
origin: org.eclipse.egit/ui

private String createFileName() {
  String suggestedFileName = getCommit() != null ? CreatePatchOperation
      .suggestFileName(getCommit()) : getRepository().getWorkTree()
      .getName().concat(".patch"); //$NON-NLS-1$
  String path = getDialogSettings().get(PATH_KEY);
  if (path != null)
    return Path.fromPortableString(path).append(suggestedFileName).toOSString();
  return (new File(System.getProperty("user.dir", ""), suggestedFileName)).getPath(); //$NON-NLS-1$ //$NON-NLS-2$
}
origin: org.eclipse/org.eclipse.jdt.ui

private String getVariableString(IPath path) {
  String name= path.makeRelative().toString();
  IPath entryPath= JavaCore.getClasspathVariable(path.segment(0));
  if (entryPath != null) {
    String appended= entryPath.append(path.removeFirstSegments(1)).toOSString();
    return Messages.format(NewWizardMessages.CPListLabelProvider_twopart, new String[] { name, appended }); 
  } else {
    return name;
  }
}

origin: org.eclipse.jdt/org.eclipse.jdt.ui

public void setLocation(IPath path) {
  fUseDefaults.setSelection(path == null);
  if (path != null) {
    fLocation.setText(path.toOSString());
  } else {
    fLocation.setText(getDefaultPath(fNameGroup.getName()));
  }
  fireEvent();
}
origin: org.eclipse.tycho/org.eclipse.jdt.core

SourceMapper createSourceMapper(IPath sourcePath, IPath rootPath) throws JavaModelException {
  IClasspathEntry entry = ((JavaProject) getParent()).getClasspathEntryFor(getPath());
  String encoding = (entry== null) ? null : ((ClasspathEntry) entry).getSourceAttachmentEncoding();
  SourceMapper mapper = new SourceMapper(
    sourcePath,
    rootPath == null ? null : rootPath.toOSString(),
    getJavaProject().getOptions(true),// cannot use workspace options if external jar is 1.5 jar and workspace options are 1.4 options
    encoding);

  return mapper;
}
/*
origin: org.eclipse.pde/org.eclipse.pde.ui

@Override
public String getText(Object obj) {
  IClasspathEntry entry = (IClasspathEntry) obj;
  int kind = entry.getEntryKind();
  if (kind == IClasspathEntry.CPE_PROJECT)
    return entry.getPath().segment(0);
  IPath path = entry.getPath();
  String name = path.lastSegment();
  return name + " - " //$NON-NLS-1$
      + path.uptoSegment(path.segmentCount() - 1).toOSString();
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

SourceMapper createSourceMapper(IPath sourcePath, IPath rootPath) throws JavaModelException {
  IClasspathEntry entry = ((JavaProject) getParent()).getClasspathEntryFor(getPath());
  String encoding = (entry== null) ? null : ((ClasspathEntry) entry).getSourceAttachmentEncoding();
  SourceMapper mapper = new SourceMapper(
    sourcePath,
    rootPath == null ? null : rootPath.toOSString(),
    getJavaProject().getOptions(true),// cannot use workspace options if external jar is 1.5 jar and workspace options are 1.4 options
    encoding);

  return mapper;
}
/*
org.eclipse.core.runtimeIPathtoOSString

Javadoc

Returns a string representation of this path which uses the platform-dependent path separator defined by java.io.File. This method is like toString() except that the latter always uses the same separator (/) regardless of platform.

This string is suitable for passing to java.io.File(String).

Popular methods of IPath

  • toString
    Returns a string representation of this path, including its device id. The same separator, "/", is u
  • toFile
    Returns a java.io.File corresponding to this path.
  • append
    Returns the canonicalized path obtained from the concatenation of the given path's segments to the e
  • segmentCount
    Returns the number of segments in this path. Note that both root and empty paths have 0 segments.
  • removeLastSegments
    Returns a copy of this path with the given number of segments removed from the end. The device id is
  • lastSegment
    Returns the last segment of this path, ornull if it does not have any segments.
  • removeFirstSegments
    Returns a copy of this path with the given number of segments removed from the beginning. The device
  • segment
    Returns the specified segment of this path, ornull if the path does not have such a segment.
  • equals
    Returns whether this path equals the given object. Equality for paths is defined to be: same sequenc
  • isAbsolute
    Returns whether this path is an absolute path (ignoring any device id). Absolute paths start with a
  • isPrefixOf
    Returns whether this path is a prefix of the given path. To be a prefix, this path's segments must a
  • toPortableString
    Returns a platform-neutral string representation of this path. The format is not specified, except t
  • isPrefixOf,
  • toPortableString,
  • makeRelative,
  • makeAbsolute,
  • getDevice,
  • isEmpty,
  • addTrailingSeparator,
  • getFileExtension,
  • setDevice

Popular in Java

  • Updating database using SQL prepared statement
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • putExtra (Intent)
  • notifyDataSetChanged (ArrayAdapter)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Path (java.nio.file)
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now