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

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

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

origin: org.eclipse/org.eclipse.jst.pagedesigner

/**
 * @param path
 * @param host
 * @return String
 */
private String getPath(IPath path, String host) {
  IPath newPath = path;
  // They are potentially for only Windows operating system.
  // a.) if path has a device, and if it begins with IPath.SEPARATOR,
  // remove it
  final String device = path.getDevice();
  if ((device != null) && (device.length() > 0)) {
    if (device.charAt(0) == IPath.SEPARATOR) {
      final String newDevice = device.substring(1);
      newPath = path.setDevice(newDevice);
    }
  }
  // b.) if it has a hostname, it is UNC name... Any java or eclipse api
  // helps it ??
  if (path != null && host != null && host.length() != 0) {
    IPath uncPath = new Path(host);
    uncPath = uncPath.append(path);
    newPath = uncPath.makeUNC(true);
  }
  return newPath.toString();
}
origin: org.eclipse.equinox/common

public IPath append(IPath tail) {
  //optimize some easy cases
  if (tail == null || tail.segmentCount() == 0)
    return this;
  //these call chains look expensive, but in most cases they are no-ops
  if (this.isEmpty())
    return tail.setDevice(device).makeRelative().makeUNC(isUNC());
  if (this.isRoot())
    return tail.setDevice(device).makeAbsolute().makeUNC(isUNC());
  //concatenate the two segment arrays
  int myLen = segments.length;
  int tailLen = tail.segmentCount();
  String[] newSegments = new String[myLen + tailLen];
  System.arraycopy(segments, 0, newSegments, 0, myLen);
  for (int i = 0; i < tailLen; i++) {
    newSegments[myLen + i] = tail.segment(i);
  }
  //use my leading separators and the tail's trailing separator
  Path result = new Path(device, newSegments, (separators & (HAS_LEADING | IS_UNC)) | (tail.hasTrailingSeparator() ? HAS_TRAILING : 0));
  String tailFirstSegment = newSegments[myLen];
  if (tailFirstSegment.equals("..") || tailFirstSegment.equals(".")) { //$NON-NLS-1$ //$NON-NLS-2$
    result.canonicalize();
  }
  return result;
}
origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.equinox.common

public IPath append(IPath tail) {
  //optimize some easy cases
  if (tail == null || tail.segmentCount() == 0)
    return this;
  //these call chains look expensive, but in most cases they are no-ops
  if (this.isEmpty())
    return tail.setDevice(device).makeRelative().makeUNC(isUNC());
  if (this.isRoot())
    return tail.setDevice(device).makeAbsolute().makeUNC(isUNC());
  //concatenate the two segment arrays
  int myLen = segments.length;
  int tailLen = tail.segmentCount();
  String[] newSegments = new String[myLen + tailLen];
  System.arraycopy(segments, 0, newSegments, 0, myLen);
  for (int i = 0; i < tailLen; i++) {
    newSegments[myLen + i] = tail.segment(i);
  }
  //use my leading separators and the tail's trailing separator
  Path result = new Path(device, newSegments, (separators & (HAS_LEADING | IS_UNC)) | (tail.hasTrailingSeparator() ? HAS_TRAILING : 0));
  String tailFirstSegment = newSegments[myLen];
  if (tailFirstSegment.equals("..") || tailFirstSegment.equals(".")) { //$NON-NLS-1$ //$NON-NLS-2$
    result.canonicalize();
  }
  return result;
}
origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.common

@Override
public IPath append(IPath tail) {
  //optimize some easy cases
  if (tail == null || tail.segmentCount() == 0)
    return this;
  //these call chains look expensive, but in most cases they are no-ops
  //the tail must be for the same platform as this instance
  if (this.isEmpty() && ((flags & IS_FOR_WINDOWS) == 0) == tail.isValidSegment(":")) //$NON-NLS-1$
    return tail.setDevice(device).makeRelative().makeUNC(isUNC());
  if (this.isRoot() && ((flags & IS_FOR_WINDOWS) == 0) == tail.isValidSegment(":")) //$NON-NLS-1$
    return tail.setDevice(device).makeAbsolute().makeUNC(isUNC());
  //concatenate the two segment arrays
  int myLen = segments.length;
  int tailLen = tail.segmentCount();
  String[] newSegments = new String[myLen + tailLen];
  System.arraycopy(segments, 0, newSegments, 0, myLen);
  for (int i = 0; i < tailLen; i++) {
    newSegments[myLen + i] = tail.segment(i);
  }
  //use my leading separators and the tail's trailing separator
  Path result = new Path(device, newSegments, (flags & (HAS_LEADING | IS_UNC | IS_FOR_WINDOWS)) | (tail.hasTrailingSeparator() ? HAS_TRAILING : 0));
  String tailFirstSegment = newSegments[myLen];
  if (tailFirstSegment.equals("..") || tailFirstSegment.equals(".")) { //$NON-NLS-1$ //$NON-NLS-2$
    result.canonicalize();
  }
  return result;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.equinox.common

@Override
public IPath append(IPath tail) {
  //optimize some easy cases
  if (tail == null || tail.segmentCount() == 0)
    return this;
  //these call chains look expensive, but in most cases they are no-ops
  //the tail must be for the same platform as this instance
  if (this.isEmpty() && ((flags & IS_FOR_WINDOWS) == 0) == tail.isValidSegment(":")) //$NON-NLS-1$
    return tail.setDevice(device).makeRelative().makeUNC(isUNC());
  if (this.isRoot() && ((flags & IS_FOR_WINDOWS) == 0) == tail.isValidSegment(":")) //$NON-NLS-1$
    return tail.setDevice(device).makeAbsolute().makeUNC(isUNC());
  //concatenate the two segment arrays
  int myLen = segments.length;
  int tailLen = tail.segmentCount();
  String[] newSegments = new String[myLen + tailLen];
  System.arraycopy(segments, 0, newSegments, 0, myLen);
  for (int i = 0; i < tailLen; i++) {
    newSegments[myLen + i] = tail.segment(i);
  }
  //use my leading separators and the tail's trailing separator
  Path result = new Path(device, newSegments, (flags & (HAS_LEADING | IS_UNC | IS_FOR_WINDOWS)) | (tail.hasTrailingSeparator() ? HAS_TRAILING : 0));
  String tailFirstSegment = newSegments[myLen];
  if (tailFirstSegment.equals("..") || tailFirstSegment.equals(".")) { //$NON-NLS-1$ //$NON-NLS-2$
    result.canonicalize();
  }
  return result;
}
origin: org.eclipse.platform/org.eclipse.core.resources

if (i == 0 && path.isUNC()) {
  realPath = realPath.append(segment.toUpperCase());
  realPath = realPath.makeUNC(true);
} else {
  if (MACOSX) {
origin: org.eclipse.scout.sdk.deps/org.eclipse.core.resources

if (i == 0 && path.isUNC()) {
  realPath = realPath.append(segment.toUpperCase());
  realPath = realPath.makeUNC(true);
} else {
  if (MACOSX) {
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.core.resources

if (i == 0 && path.isUNC()) {
  realPath = realPath.append(segment.toUpperCase());
  realPath = realPath.makeUNC(true);
} else {
  if (MACOSX) {
org.eclipse.core.runtimeIPathmakeUNC

Javadoc

Return a new path which is the equivalent of this path converted to UNC form (if the given boolean is true) or this path not as a UNC path (if the given boolean is false). If UNC, the returned path will not have a device and the first 2 characters of the path string will be Path.SEPARATOR. If not UNC, the first 2 characters of the returned path string will not be Path.SEPARATOR.

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

  • Reading from database using SQL prepared statement
  • getContentResolver (Context)
  • getSystemService (Context)
  • onCreateOptionsMenu (Activity)
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Reference (javax.naming)
  • JPanel (javax.swing)
  • IsNull (org.hamcrest.core)
    Is the value null?
  • CodeWhisperer alternatives
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