congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
IPath.isAbsolute
Code IndexAdd Tabnine to your IDE (free)

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

Best Java code snippets using org.eclipse.core.runtime.IPath.isAbsolute (Showing top 20 results out of 567)

origin: org.eclipse/org.eclipse.jst.j2ee.core

public static void verifyRelative(IPath archiveRelativePath) {
  if (archiveRelativePath.isAbsolute() && !archiveRelativePath.equals(IArchive.EMPTY_MODEL_PATH)) {
    throw new RuntimeException(archiveRelativePath + " must be relative."); //$NON-NLS-1$
  }
}
origin: org.eclipse.equinox.p2.touchpoint/eclipse

public static String makeRelative(String original, String rootPath) {
  IPath path = new Path(original);
  // ensure we have an absolute path to start with
  if (!path.isAbsolute())
    return original;
  //Returns the original string if no relativization has been done
  String result = makeRelative(path, new Path(rootPath));
  return path.toOSString().equals(result) ? original : result;
}
origin: org.eclipse.platform/org.eclipse.equinox.frameworkadmin.equinox

public static String makeRelative(String original, String rootPath) {
  IPath path = new Path(original);
  // ensure we have an absolute path to start with
  if (!path.isAbsolute())
    return original;
  //Returns the original string if no relativization has been done
  IPath result = path.makeRelativeTo(new Path(rootPath));
  return path.equals(result) ? original : result.toString();
}
origin: org.eclipse.equinox.frameworkadmin/equinox

public static String makeRelative(String original, String rootPath) {
  IPath path = new Path(original);
  // ensure we have an absolute path to start with
  if (!path.isAbsolute())
    return original;
  //Returns the original string if no relativization has been done
  IPath result = path.makeRelativeTo(new Path(rootPath));
  return path.equals(result) ? original : result.toString();
}
origin: eclipse/buildship

private static File relativePathToProjectRoot(IPath projectPath, String path) {
  IPath pathToRoot = new Path(path);
  IPath absolutePathToRoot = pathToRoot.isAbsolute() ? pathToRoot : RelativePathUtils.getAbsolutePath(projectPath, pathToRoot);
  return canonicalize(absolutePathToRoot.toFile());
}
origin: org.eclipse.platform/org.eclipse.core.resources

/**
 * @see IPathVariableManager#validateValue(IPath)
 */
@Override
public IStatus validateValue(IPath value) {
  if (value != null && (!value.isValidPath(value.toString()) || !value.isAbsolute())) {
    String message = Messages.pathvar_invalidValue;
    return new ResourceStatus(IResourceStatus.INVALID_VALUE, null, message);
  }
  return Status.OK_STATUS;
}
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.equinox.p2.touchpoint.eclipse

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('}', ':');
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.core.resources

/**
 * @see IPathVariableManager#validateValue(IPath)
 */
@Override
public IStatus validateValue(IPath value) {
  if (value != null && (!value.isValidPath(value.toString()) || !value.isAbsolute())) {
    String message = Messages.pathvar_invalidValue;
    return new ResourceStatus(IResourceStatus.INVALID_VALUE, null, message);
  }
  return Status.OK_STATUS;
}
origin: org.eclipse.equinox.p2.touchpoint/eclipse

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('}', ':');
}
origin: org.eclipse.platform/org.eclipse.ltk.core.refactoring

public static IPath handleToResourcePath(final String project, final String handle) {
  final IPath path= Path.fromPortableString(handle);
  if (project != null && project.length() > 0 && !path.isAbsolute())
    return new Path(project).append(path).makeAbsolute();
  return path;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.ltk.core.refactoring

public static IPath handleToResourcePath(final String project, final String handle) {
  final IPath path= Path.fromPortableString(handle);
  if (project != null && project.length() > 0 && !path.isAbsolute())
    return new Path(project).append(path).makeAbsolute();
  return path;
}
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.core.resources

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);
  }
}
origin: org.eclipse/org.eclipse.jst.ws.consumption.ui

public String getComponentName(){
 IResource resource = getResourceFromInitialSelection();
 if (resource!=null) {
  IPath absolutePath = resource.getFullPath();
  if (absolutePath.isAbsolute()) {
   return absolutePath.segment(1);
  }
 }
 return null;
}

origin: org.eclipse.scout.sdk.deps/org.eclipse.core.resources

protected IPath makePathAbsolute(IPath target) {
  if (target.isAbsolute())
    return target;
  return getParent().getFullPath().append(target);
}
origin: org.eclipse.platform/org.eclipse.core.resources

protected IPath makePathAbsolute(IPath target) {
  if (target.isAbsolute())
    return target;
  return getParent().getFullPath().append(target);
}
origin: org.eclipse.platform/org.eclipse.core.resources

/**
 * @deprecated use {@link #resolveURI(URI)} instead.
 */
@Override
@Deprecated
public IPath resolvePath(IPath path) {
  if (path == null || path.segmentCount() == 0 || path.isAbsolute() || path.getDevice() != null)
    return path;
  URI value = resolveURI(URIUtil.toURI(path));
  return value == null ? path : URIUtil.toPath(value);
}
origin: org.eclipse.platform/org.eclipse.core.resources

/**
 * @see org.eclipse.core.resources.IPathVariableManager#resolvePath(IPath)
 */
@Deprecated
@Override
public IPath resolvePath(IPath path) {
  if (path == null || path.segmentCount() == 0 || path.isAbsolute() || path.getDevice() != null)
    return path;
  IPath value = getValue(path.segment(0));
  return value == null ? path : value.append(path.removeFirstSegments(1));
}
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.core.resources

/**
 * @see org.eclipse.core.resources.IPathVariableManager#resolvePath(IPath)
 */
@Deprecated
@Override
public IPath resolvePath(IPath path) {
  if (path == null || path.segmentCount() == 0 || path.isAbsolute() || path.getDevice() != null)
    return path;
  IPath value = getValue(path.segment(0));
  return value == null ? path : value.append(path.removeFirstSegments(1));
}
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.core.resources

  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);
      }
    }
  }
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.core.resources

  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);
      }
    }
  }
}
org.eclipse.core.runtimeIPathisAbsolute

Javadoc

Returns whether this path is an absolute path (ignoring any device id).

Absolute paths start with a path separator. A root path, like / or C:/, is considered absolute. UNC paths are always absolute.

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.
  • toOSString
    Returns a string representation of this path which uses the platform-dependent path separator define
  • 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
  • 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

  • Reading from database using SQL prepared statement
  • findViewById (Activity)
  • onCreateOptionsMenu (Activity)
  • getResourceAsStream (ClassLoader)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Best IntelliJ plugins
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