code: protected URL getURI(File file)
          throws MalformedURLException {
  
  
          File realFile = file;
          try {
              realFile = realFile.getCanonicalFile();
          } catch (IOException e) {
              // Ignore
          }
          return realFile.toURI().toURL();
  
      }
docs: Get URL.