Here you can find the source of getChildEntryRelativePath(Path base, Path child, boolean convertToLinuxPath)
public static String getChildEntryRelativePath(Path base, Path child, boolean convertToLinuxPath)
//package com.java2s; //License from project: Apache License import java.nio.file.*; public class Main { public static String getChildEntryRelativePath(Path base, Path child, boolean convertToLinuxPath) { String path = base.toUri().relativize(child.toUri()).getPath(); if (convertToLinuxPath && !"/".equals(base.getFileSystem().getSeparator())) { return path.replace(base.getFileSystem().getSeparator(), "/"); } else {//w w w .ja va2s.c om return path; } } }