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

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

Best Java code snippets using org.eclipse.core.runtime.IPath.clone (Showing top 5 results out of 315)

origin: biz.aQute/aQute.bnd

public static void refresh(IPath path) {
  try {
    IResource r = ResourcesPlugin.getWorkspace().getRoot().findMember(
        path);
    if (r != null)
      return;
    IPath p = (IPath) path.clone();
    while (p.segmentCount() > 0) {
      p = p.removeLastSegments(1);
      IResource resource = ResourcesPlugin.getWorkspace().getRoot()
          .findMember(p);
      if (resource != null) {
        resource.refreshLocal(2, null);
        return;
      }
    }
  } catch (Exception e) {
    Activator.getDefault().error("While refreshing path " + path, e);
  }
  System.out.println("Unexpectedly could not find path in workspace: "
      + path);
}
origin: biz.aQute/bnd

public static void refresh(IPath path) {
  try {
    IResource r = ResourcesPlugin.getWorkspace().getRoot().findMember(
        path);
    if (r != null)
      return;
    IPath p = (IPath) path.clone();
    while (p.segmentCount() > 0) {
      p = p.removeLastSegments(1);
      IResource resource = ResourcesPlugin.getWorkspace().getRoot()
          .findMember(p);
      if (resource != null) {
        resource.refreshLocal(2, null);
        return;
      }
    }
  } catch( ResourceException re ) {
    // TODO Ignore for now
  }
  catch (Exception e) {
    Activator.getDefault().error("While refreshing path " + path, e);
  }
}
origin: io.sarl/io.sarl.eclipse

private File getProjectFolderForSourceFolder(File file) {
  final IPath filePath = Path.fromOSString(file.getAbsolutePath());
  for (final String rawPath : this.candidates) {
    final IPath path = Path.fromPortableString(rawPath);
    IPath parent = null;
    IPath fp = (IPath) filePath.clone();
    while (fp != null) {
      if (path.isPrefixOf(fp)) {
        if (parent == null) {
          return file.getParentFile();
        }
        return parent.toFile();
      }
      if (parent == null) {
        parent = Path.fromPortableString("/" + fp.segment(0)); //$NON-NLS-1$
      } else {
        parent = parent.append(fp.segment(0));
      }
      if (fp.segmentCount() > 1) {
        fp = fp.removeFirstSegments(1);
      } else {
        fp = null;
      }
    }
  }
  return null;
}
origin: xzer/run-jetty-run

private void addWebappAttr(ILaunchConfiguration configuration,
    List<String> runtimeVmArgs, String cfgAttr) throws CoreException {
  IJavaProject proj = this.getJavaProject(configuration);
  if (proj == null)
    return;
  String value = configuration.getAttribute(cfgAttr, "");
  if ("/".equals(value)) {
    IPath path = (IPath) proj.getResource().getLocation().clone();
    path.makeAbsolute();
    value = path.toOSString();
  } else {
    if (proj.getProject().getFolder(value).getLocation() == null) {
      throw new IllegalStateException(
          "raw location shouldn't be null");
    }
    value = proj.getProject().getFolder(value).getLocation()
        .toOSString();
  }
  if (value.length() == 0)
    return;
  String arg = "-Drjr" + "webapp" + "=" + value + "";
  runtimeVmArgs.add(arg);
  return;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

IPath initPath = (IPath) path.clone();
org.eclipse.core.runtimeIPathclone

Javadoc

Returns a copy of this path.

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
  • 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
  • isAbsolute,
  • isPrefixOf,
  • toPortableString,
  • makeRelative,
  • makeAbsolute,
  • getDevice,
  • isEmpty,
  • addTrailingSeparator,
  • getFileExtension,
  • setDevice

Popular in Java

  • Making http requests using okhttp
  • onCreateOptionsMenu (Activity)
  • getExternalFilesDir (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • From CI to AI: The AI layer in your organization
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