Change this to a straight path name without /../ references (Required for 'create directory').
@return The new path string.
969431
public static String normalizePath(String path)
    {
        StringBuilder sb = new StringBuilder(path);
        int lastToken = -1;
        for (int i = 0; i < sb.length(); i++)
        {
            if ((sb.charAt(i) == File.separatorChar)
                || (sb.charAt(i) == '/'))
            {
                if (lastToken != -1)
                {
                    if (i < sb.length() - 2)
                        if (sb.charAt(i + 1) == '.')
                            if (sb.charAt(i + 2) == '.')
                    {   // Remove last directory name from path
                        sb.delete(lastToken, i + 3);
                        i = lastToken;
                    }
                }
                lastToken = i;
            }
        }
        return sb.toString();
    }
574666
public static String[] translatePathName(String path) {
	path = prettifyPath(path);
	if (path.indexOf('/') != 0) path = '/' + path;
	int index = path.lastIndexOf('/');
	// remove slash at the end
	if (index == path.length() - 1) path = path.substring(0, path.length() - 1);

	index = path.lastIndexOf('/');
	String name;
	if (index == -1) {
	    name = path;
	    path = "/";
	}
	else {
	    name = path.substring(index + 1);
	    path = path.substring(0, index + 1);
	}
	return new String[] { path, name };
    }
562832
public UriBuilder path(String path) throws URISyntaxException {
        path = path.trim();
        if (getPath().endsWith("/")) {
            return new UriBuilder(setPath(String.format("%s%s", getPath(), path)));
        } else {
            return new UriBuilder(setPath(String.format("%s/%s", getPath(), path)));
        }
    }
1165197
public String getIDPath()
    {
        String strIDPath = this.getID();
        if (this.getParentProxy() != null)
        {
            String strParentPath = this.getParentProxy().getIDPath();
            if (strParentPath != null)
                strIDPath = strParentPath + PATH_SEPARATOR + strIDPath;
        }
        return strIDPath;
    }
104242
public String[] getSpillingDirectoriesPaths() {
		String[] strings = new String[this.paths.length];
		for (int i = 0; i < strings.length; i++) {
			strings[i] = paths[i].getAbsolutePath();
		}
		return strings;
	}
382626
public String getPathName()
    {
    if( pathName_ == null)
      {
      StringBuilder pathName = new StringBuilder();

      IVarDef parent = getParent();
      if( parent != null)
        {
        pathName
          .append( parent.getPathName())
          .append( '.');
        }

      String name = getName();
      if( name != null)
        {
        pathName.append( name);
        }

      pathName_ = pathName.toString();
      }

    return pathName_;
    }
1152983
public String constructName() {
        String result = name;
        if(dir != null) {
            result = dir + "/" + result;
        }
        if(extension != null) {
            result = result + "." + extension;
        }
        return result;
    }
1125367
public char[] getRawName() {
        if (_path == null) { 
            return null;
        }

        int at = 0;
        for (int i = _path.length - 1; i >= 0; i--) {
            if (_path[i] == '/') {
                at = i + 1;
                break;
            }
        }
        int len = _path.length - at;
        char[] basename =  new char[len];
        System.arraycopy(_path, at, basename, 0, len);
        return basename;
    }
1235944
public File getDestPath(String sourcePath)
    {
        String destPathname = DBConstants.BLANK;

        String dirPrefix = this.getProperty(DIR_PREFIX);
        String sourceDir = this.getProperty(SOURCE_DIR);
        String destDir = this.getProperty(DEST_DIR);
        int startPath = sourcePath.indexOf(sourceDir);
        
        // Now add the start of the source path
        if ((dirPrefix != null) && (sourceDir != null) && (sourceDir.length() > 0) && (sourcePath.indexOf(dirPrefix) == 0))
    		destPathname += dirPrefix;
        else
        {
        	if ((!destDir.startsWith("/")) && (!destDir.startsWith(File.separator)))
        	{
        		if (startPath == 0)
        		{
        			int iEndStartPath = sourceDir.lastIndexOf(File.separator);
        			if (iEndStartPath == -1)
        				iEndStartPath = sourceDir.lastIndexOf('/');
        			if (iEndStartPath > 0)
        				destPathname += sourceDir.substring(0, iEndStartPath + 1);
        		}
        	}
        }
        
        destPathname = Utility.addToPath(destPathname, destDir);
        
        if (startPath != -1)
        	destPathname = Utility.addToPath(destPathname, sourcePath.substring(startPath + sourceDir.length()));

        return new File(destPathname);
    }
355167
def path(path_name=None, override=None, *, root=None, name=None, ext=None,
         inject=None, relpath=None, reduce=False):
    
    path_name, identity, root = _initialize(path_name, override, root, inject)
    new_name = _process_name(path_name, identity, name, ext)
    new_directory = _process_directory(path_name, identity, root, inject)
    full_path = os.path.normpath(os.path.join(new_directory, new_name))
    if APPEND_SEP_TO_DIRS and not new_name and full_path[-1] != os.sep:
        full_path += os.sep
    final_path = _format_path(full_path, root, relpath, reduce)
    return final_path
321081
public Path[] getFilePaths() {

		if (supportsMultiPaths()) {
			if (this.filePaths == null) {
				return new Path[0];
			}
			return this.filePaths;
		} else {
			if (this.filePath == null) {
				return new Path[0];
			}
			return new Path[] {filePath};
		}
	}
305426
public PathTemplate withoutVars() {
    StringBuilder result = new StringBuilder();
    ListIterator<Segment> iterator = segments.listIterator();
    boolean start = true;
    while (iterator.hasNext()) {
      Segment seg = iterator.next();
      switch (seg.kind()) {
        case BINDING:
        case END_BINDING:
          break;
        default:
          if (!start) {
            result.append(seg.separator());
          } else {
            start = false;
          }
          result.append(seg.value());
      }
    }
    return create(result.toString(), urlEncoding);
  }
454843
public String constructShortName() {
        String result = shortName;
        if(dir != null) {
            result = dir + "/" + result;
        }
        if(extension != null) {
            result = result + "." + extension;
        }
        return result;
    }
732683
public String getAsPath() {
    // String.replaceAll() - cannot be used because of it uses a regex as a
    // parameter and a '.'(dot) means a any symbol.
    StringBuffer str = new StringBuffer();
    for (int i = 0; i < folderId.length(); i++)
      if (folderId.charAt(i) == '.')
        str.append('/');
      else
        str.append(folderId.charAt(i));
    return str.toString();
  }
535303
public PathImpl getWritePath()
  {
    ArrayList<PathImpl> pathList = getPathList();

    if (pathList.size() == 0)
      return new NotFoundPath(getSchemeMap(), _pathname);
    else {
      return pathList.get(0);
    }
  }
950400
protected String generateUniquePath() {
        File parent;
        String destinationPath;
        do {
            destinationPath = UUID.randomUUID().toString();

            parent = getFileByPath(destinationPath);
        } while (parent.exists());

        return destinationPath;
    }
1058625
public static RenamedPathResource renameResource(String path,
                                                     Resource.Readable resource) {
        return new RenamedPathResource(path, resource);
    }