class FileUtils {

    public static String toRelativeClassPath(Path path, ClassLoader cl) {
        if (isJarPath(path.toUri())) {
            return CLASSPATH_COLON + toStandardPath(path.toString());
        }
        for (URL url : getAllClassPathUrls(cl)) {
            Path rootPath = urlToPath(url, null);
            if (rootPath != null && path.startsWith(rootPath)) {
                Path relativePath = rootPath.relativize(path);
                return CLASSPATH_COLON + toStandardPath(relativePath.toString());
            }
        }
        // we didn't find this on the classpath, fall back to absolute
        return path.toString().replace('\\', '/');
    }

    private  FileUtils();

}