private static URL getURL(String dir) throws MalformedURLException {
    logger.info("URL not transformed: " + dir);
    // check for Windows naming
    if (dir.indexOf("\\") != -1) {
      // Windows!
      // 4 \ to obtain \\ in a regexp
      dir = dir.replaceAll("\\\\", "/");
    }
    /*  dir starts with file:, we consider it as complete (classpath
     *  or absolute). Otherwise, we just add file: and assume classpath.
     */
    if (! dir.startsWith("file:")) {
      dir = "file:" + dir;
    }
    logger.info("URL transformed: " + dir);
    return new URL(dir);
  }