code: public URI toURI() {
          String name = getAbsoluteName();
          try {
              if (!name.startsWith("/")) {
                  // start with sep.
                  return new URI("file", null, "/" + name, null, null);
              } else if (name.startsWith("//")) {
                  return new URI("file", "", name, null); // UNC path
              }
              return new URI("file", null, name, null, null);
          } catch (URISyntaxException e) {
              // this should never happen
              return null;
          }
      }
docs: Returns a Uniform Resource Identifier for this file. The URI is system
  dependent and may not be transferable between different operating / file
  systems.
  
  @return an URI for this file.