Java URI to Relative URI getRelativeName(File file, URI directory)

Here you can find the source of getRelativeName(File file, URI directory)

Description

get Relative Name

License

Open Source License

Declaration

public static String getRelativeName(File file, URI directory) throws IOException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.File;

import java.io.IOException;

import java.net.URI;

public class Main {
    public static String getRelativeName(File file, URI directory) throws IOException {
        URI fUri = file.toURI();//ww  w  .  j  a v  a2s .c  o  m
        return directory.relativize(fUri).getPath();
    }
}

Related

  1. getRedirectUri(URI uri, String location)
  2. getRelativeLocalURI(String suffix)
  3. getRelativePath(URI base, File file)
  4. getRelativePath(URI targetURI, URI baseURI)
  5. getRelativePath(URI targetUri, URI baseUri)
  6. getRelativeURI(String href)