code: private static String normalizePath(String absPath)
     {
        if (absPath.endsWith("/"))
        {
           return absPath.substring(0, absPath.length() - 1);
        }
  
        return absPath;
     }
docs: Normalizes path. Returns string without character </code>/</code> at the end.