Java Path Normalize normalize(String path, String separator)

Here you can find the source of normalize(String path, String separator)

Description

normalize

License

LGPL

Declaration

private static String normalize(String path, String separator) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

public class Main {
    private static String normalize(String path, String separator) {
        path = path.replace(separator + separator, separator);
        path = path.replace(separator + separator, separator);
        if (path.endsWith(separator)) {
            path = path.substring(0, path.length() - 1);
        }/*from   w  w  w  .j a  va2  s  .c  om*/
        return path;
    }
}

Related

  1. normalize(String path)
  2. normalize(String path)
  3. normalize(String path)
  4. normalize(String path)
  5. normalize(String path)
  6. normalize(String pathname, int len, int off)
  7. normalize_color_path(int eff_color_path)
  8. normalizeAllSeparators(String path)
  9. normalizeBasePath(String basePath)