return path.replace('/', File.separatorChar);
path = path.replace('/', File.separatorChar); if (path.trim().length() == 0) { path = "."; } return path;
    public static String getPath(File file) {        String path = "";        String rootPath = "";        try {            path = file.getCanonicalPath();            rootPath = new File("").getCanonicalPath();        } catch (IOException e) {            path = file.getAbsolutePath();            rootPath = new File("").getAbsolutePath();        }        path = path.replace(File.separatorChar, '/');        rootPath = rootPath.replace(File.separatorChar, '/');        if (path.startsWith(rootPath)) {            path = path.substring(rootPath.length());        }        path = PathUtil.removeLeadingSlash(path);        path = PathUtil.removeTrailingSlash(path);        return path.replace('/', File.separatorChar);    }