Java Relative Path Get relativeFrom(File from, File to)

Here you can find the source of relativeFrom(File from, File to)

Description

relative From

License

Open Source License

Declaration

public static String relativeFrom(File from, File to) 

Method Source Code

//package com.java2s;
// {LICENSE}//from  www .java 2 s  .c o m

import java.io.File;

public class Main {
    public static String relativeFrom(File from, File to) {
        return from.toURI().relativize(to.toURI()).getPath();
    }
}

Related

  1. relativeFile(File file, String relativeTo)
  2. relativeFile(Iterable paths, String file)
  3. relativeFileName(final File baseDir, final File file)
  4. relativePath(File baseDir, File child)
  5. relativePath(File baseDir, File storeFile)
  6. relativePath(File baseDir, File storeFile)
  7. relativePath(File descendant, File root)