build an absolute, normalized and symbolic link free path of the same file or dir

@return
504025
public EightyPath to() {
        EightyPath inital = start;

        final RealIt it = new RealIt( start );
        if( !Repeater.repeat().
                upto( 1000 ).
                until( () -> {
                    it.set( minusOne( it ) );
                    return !it.foundSymLink;
                } ) ) {
            throw new IllegalStateException( "sym link loop detected in path " + start );
        }

        EightyPath ret = it.path;

        if( inital.equals( ret ) ) {
            inital.setTestedReal();
            return inital;
        }

        ret.setTestedReal();
        return ret;
    }
647564
public String buildRightsList() {

        StringBuffer result = new StringBuffer(
            dialogToggleStart(
                key(Messages.GUI_PERMISSION_BEQUEATH_SUBFOLDER_0),
                "inheritedpermissions",
                getSettings().getUserSettings().getDialogExpandInheritedPermissions()
                    || getShowInheritedPermissions()));

        // store all parent folder ids together with path in a map
        Map<CmsUUID, String> parents = new HashMap<CmsUUID, String>();
        String path = CmsResource.getParentFolder(getParamResource());
        List<CmsResource> parentResources = new ArrayList<CmsResource>();
        try {
            // get all parent folders of the current file
            parentResources = getCms().readPath(path, CmsResourceFilter.IGNORE_EXPIRATION);
        } catch (CmsException e) {
            // can usually be ignored
            if (LOG.isInfoEnabled()) {
                LOG.info(e.getLocalizedMessage());
            }
        }
        Iterator<CmsResource> k = parentResources.iterator();
        while (k.hasNext()) {
            // add the current folder to the map
            CmsResource curRes = k.next();
            parents.put(curRes.getResourceId(), curRes.getRootPath());
        }

        // create new ArrayLists in which inherited and non inherited entries are stored
        ArrayList<CmsAccessControlEntry> ownEntries = new ArrayList<CmsAccessControlEntry>();
        try {
            Iterator<CmsAccessControlEntry> itAces = getCms().getAccessControlEntries(
                getParamResource(),
                false).iterator();
            while (itAces.hasNext()) {
                CmsAccessControlEntry curEntry = itAces.next();
                if (!curEntry.isInherited()) {
                    // add the entry to the own rights list
                    ownEntries.add(curEntry);
                }
            }
        } catch (CmsException e) {
            // can usually be ignored
            if (LOG.isInfoEnabled()) {
                LOG.info(e.getLocalizedMessage());
            }
        }

        ArrayList<CmsAccessControlEntry> inheritedEntries = new ArrayList<CmsAccessControlEntry>();
        try {
            Iterator<CmsAccessControlEntry> itAces = getCms().getAccessControlEntries(path, true).iterator();
            while (itAces.hasNext()) {
                CmsAccessControlEntry curEntry = itAces.next();
                // add the entry to the inherited rights list for the "long" view
                if ("long".equals(getSettings().getPermissionDetailView())) {
                    inheritedEntries.add(curEntry);
                }
            }
        } catch (CmsException e) {
            // can usually be ignored
            if (LOG.isInfoEnabled()) {
                LOG.info(e.getLocalizedMessage());
            }
        }

        // now create the inherited entries box
        result.append(dialogWhiteBox(HTML_START));
        result.append(buildInheritedList(inheritedEntries, parents));
        result.append(dialogWhiteBox(HTML_END));

        // close div that toggles visibility of inherited permissions
        result.append("</div>");

        // create the add user/group form
        result.append(buildAddForm());

        // create the resource entries box
        result.append(buildResourceList(ownEntries));

        return result.toString();
    }
901938
public static String createDirectoryPath(String source)
    {
       if (tc.isEntryEnabled()) Tr.entry(tc, "createDirectoryPath",source);

       String directoryPath = null;

       if (source != null)
       {
           directoryPath = "";

           final StringTokenizer tokenizer = new StringTokenizer(source,"\\/");

           while (tokenizer.hasMoreTokens())
           {
             final String pathChunk = tokenizer.nextToken();

             directoryPath += pathChunk;

             if (tokenizer.hasMoreTokens())
             {
               directoryPath += File.separator;
             }

           }
       }

       if (tc.isEntryEnabled()) Tr.exit(tc, "createDirectoryPath",directoryPath);
       return directoryPath;
    }
330247
public File curDir() {
        File file = session().attribute(ATTR_PWD);
        if (null == file) {
            file = new File(System.getProperty("user.dir"));
            session().attribute(ATTR_PWD, file);
        }
        return file;
    }
786296
private static String normalizePath(String absPath)
   {
      if (absPath.endsWith("/"))
      {
         return absPath.substring(0, absPath.length() - 1);
      }

      return absPath;
   }
1117355
public static PathImpl getTmpWorkDir()
  {
    String userName = System.getProperty("user.name");
    
    PathImpl path;
    // Windows uses /temp as a work dir
    if (com.caucho.v5.util.CauchoUtil.isWindows()
        && ! CurrentTime.isTest())
      path = VfsOld.lookup("file:/c:/tmp/" + userName);
    else
      path = VfsOld.lookup("file:/tmp/" + userName);
    
    return path;
  }
922262
public String getFilePath()
    {
        //get file
        File fileInstance=this.getFile();
        
        String filePath=null;
        if(fileInstance!=null)
        {
            filePath=fileInstance.getPath();
        }
        
        return filePath;
    }
253032
public String getPath() {

        String path = getFullPath();
        if (m_relativeTo != null) {
            path = getResource().getRootPath();
            if (path.startsWith(m_relativeTo)) {
                path = path.substring(m_relativeTo.length());
                if (path.length() == 0) {
                    path = ".";
                }
            } else {
                String site = getSite();
                if (path.startsWith(site + "/") || path.equals(site)) {
                    path = path.substring(site.length());
                }
            }
        }
        if (m_abbrevLength > 0) {
            boolean absolute = path.startsWith("/");
            path = CmsStringUtil.formatResourceName(path, m_abbrevLength);
            if (!absolute && path.startsWith("/")) {
                // remove leading '/'
                path = path.substring(1);
            }
        }
        return path;
    }
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);
    }
651673
public static String getNmtAbsolutePath(String fullPath){
		String absolutePath = "";
		if (fullPath.startsWith("file://")){
			absolutePath = fullPath.replace("file://", "");
		} else {
			absolutePath = fullPath;
		}
		return absolutePath;
	}
857321
@Override
  public File[] getLibraryPath() {
    if (this.libDirs == null) {
      final Vector<String> dirs = new Vector<>();
      // Ask GCC where it will look for its libraries.
      final String[] args = new String[] {
          "g++", "-print-search-dirs"
      };
      final String[] cmdout = CaptureStreamHandler.run(args);
      for (int i = 0; i < cmdout.length; ++i) {
        final int prefixIndex = cmdout[i].indexOf(libPrefix);
        if (prefixIndex >= 0) {
          // Special case DOS-type GCCs like MinGW or Cygwin
          int s = prefixIndex + libPrefix.length();
          int t = cmdout[i].indexOf(';', s);
          while (t > 0) {
            dirs.addElement(cmdout[i].substring(s, t));
            s = t + 1;
            t = cmdout[i].indexOf(';', s);
          }
          dirs.addElement(cmdout[i].substring(s));
          ++i;
          for (; i < cmdout.length; ++i) {
            dirs.addElement(cmdout[i]);
          }
        }
      }
      // Eliminate all but actual directories.
      final String[] libpath = new String[dirs.size()];
      dirs.copyInto(libpath);
      final int count = CUtil.checkDirectoryArray(libpath);
      // Build return array.
      this.libDirs = new File[count];
      int index = 0;
      for (final String element : libpath) {
        if (element != null) {
          this.libDirs[index++] = new File(element);
        }
      }
    }
    return this.libDirs;
  }
532152
@Override
    public Path toRealPath(final LinkOption... options) throws IOException {
        // All links are "real" (no symlinks) and absolute, so just return this (if exists)
        if (!this.fileSystem.getArchive().contains(this.path)) {
            throw new FileNotFoundException("Path points to a nonexistant file or directory: " + this.toString());
        }
        return this;
    }
392242
public static String normalizeDirPath(String dirPath) {
        if (dirPath == null || dirPath.isEmpty())
            return "";

        dirPath = dirPath.replace("\\", "/");

        if (!dirPath.endsWith("/")) {
            dirPath = dirPath + "/";
        }

        return dirPath;
    }
656550
private String buildClassPath()
  {
    String classPath = null;//_classPath;

    if (classPath != null) {
      return classPath;
    }

    if (classPath == null && _loader instanceof DynamicClassLoader) {
      classPath = ((DynamicClassLoader) _loader).getClassPath();
    }
    else { // if (true || _loader instanceof URLClassLoader) {
      StringBuilder sb = new StringBuilder();
      sb.append(CauchoUtil.getClassPath());

      if (_loader != null)
        buildClassPath(sb, _loader);

      classPath = sb.toString();
    }
    //else if (classPath == null)
      //classPath = CauchoSystem.getClassPath();

    String srcDirName = getSourceDirName();
    String classDirName = getClassDirName();

    char sep = CauchoUtil.getPathSeparatorChar();

    if (_extraClassPath != null)
      classPath = classPath + sep + _extraClassPath;

    // Adding the srcDir lets javac and jikes find source files
    if (! srcDirName.equals(classDirName))
      classPath = srcDirName + sep + classPath;
    classPath = classDirName + sep + classPath;

    return classPath;
  }
282943
@Override
    public String getPath() {
    	String result;

    	result = path.toString().substring(getRoot().getAbsolute().length());
    	return result.replace(File.separatorChar, Filesystem.SEPARATOR_CHAR);
    }
609182
protected File getGeneratedResourcesDirectory() {
    if (generatedResourcesFolder == null) {
      String generatedResourcesFolderAbsolutePath = this.project.getBuild().getDirectory() + "/" + getGeneratedResourcesDirectoryPath();
      generatedResourcesFolder = new File(generatedResourcesFolderAbsolutePath);
      if (!generatedResourcesFolder.exists()) {
        generatedResourcesFolder.mkdirs();
      }
    }
    return generatedResourcesFolder;
  }
175160
public static String normalizeResourcePath(final String path) {
		if (path == null) {
			return null;
		}
		String normalizedPath = replaceSlashes(path.trim());
		if (normalizedPath.startsWith("/") && normalizedPath.length() > 1) {
			normalizedPath = normalizedPath.substring(1);
		}
		return normalizedPath;
	}