class FileUtils {

    public static String toPackageQualifiedName(String path) {
        path = removePrefix(path);
        path = path.replace('/', '.');
        if (path.contains(":\\")) { // to remove windows drive letter and colon
            path = removePrefix(path);
        }
        if (path.indexOf('\\') != -1) { // for windows paths
            path = path.replace('\\', '.');
        }
        String packagePath = path.replace("..", "");
        if (packagePath.startsWith(".")) {
            packagePath = packagePath.substring(1);
        }
        if (packagePath.endsWith(DOT_FEATURE)) {
            packagePath = packagePath.substring(0, packagePath.length() - 8);
        }
        return packagePath;
    }

    private  FileUtils();

}