Java Unix Path getUnixRelativePath(File base, File path)

Here you can find the source of getUnixRelativePath(File base, File path)

Description

get Unix Relative Path

License

Open Source License

Declaration

public static String getUnixRelativePath(File base, File path) 

Method Source Code


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

import java.io.File;

public class Main {
    public static String getUnixRelativePath(File base, File path) {
        return base.toURI().relativize(path.toURI()).getPath().replace("\\", "/");
    }/*www  .j a  v a2s .c o  m*/
}

Related

  1. getUNIXfilePath(String fileName)
  2. toUNIXfilePath(String fileName)
  3. unixizeWindowsAbsolutePath(final String pathToCheck)
  4. unixPath(String sText)
  5. unixPathStr(String anyPath)