Java Relative Path Get relativePath(File baseDir, File child)

Here you can find the source of relativePath(File baseDir, File child)

Description

relative Path

License

Apache License

Declaration

static String relativePath(File baseDir, File child) 

Method Source Code


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

import java.io.File;

public class Main {
    static String relativePath(File baseDir, File child) {
        return baseDir.toPath().relativize(child.toPath()).toString();
    }/*w w  w . j  a  va  2  s . c  o m*/
}

Related

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