Java URI to Relative URI relativize(URI basePath, File path)

Here you can find the source of relativize(URI basePath, File path)

Description

Create path relative to base path

License

Apache License

Declaration

private static String relativize(URI basePath, File path) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.io.File;

import java.net.URI;

public class Main {
    /** Create path relative to base path */
    private static String relativize(URI basePath, File path) {
        return (basePath != null) ? basePath.relativize(path.toURI())
                .getPath() : path.getPath();
    }/*from   w w  w  .ja  v a  2  s. co  m*/
}

Related

  1. relativePath(final URI baseURI, final URI pathURI)
  2. relativeURI(String basePath, String path)
  3. relativize(URI base, URI child)
  4. relativize(URI base, URI child)
  5. relativize(URI base, URI target)
  6. relativize(URI baseUri, File f)
  7. relativize(URI baseURI, URI uriToRelativize)
  8. relativizeFromBase(String uri, URI base)
  9. resolve(String baseURI, String connectorURI)