@Test public void testInTargetDir() throws IOException { final File testDir = new File(new File("target"), "testDir"); testDir.mkdir(); final File subFolder = new File(testDir, "subFolder"); final File fileName = new File(subFolder, "fileName"); final String relPath = IoFileRelativePathUtil.getRelativePath(testDir, fileName); requireNonNull(relPath); assertTrue(fileName.getAbsolutePath().endsWith(relPath)); assertEquals("subFolder/fileName", relPath); }
static String getRelativePath(final File from, final File to) { return getRelativePath(from, to, File.separatorChar); }
IoFileRelativePathUtil { static String getRelativePath(final File from, final File to) { return getRelativePath(from, to, File.separatorChar); } }
IoFileRelativePathUtil { static String getRelativePath(final File from, final File to) { return getRelativePath(from, to, File.separatorChar); } private  IoFileRelativePathUtil(); }
IoFileRelativePathUtil { static String getRelativePath(final File from, final File to) { return getRelativePath(from, to, File.separatorChar); } private  IoFileRelativePathUtil();  }
IoFileRelativePathUtil { static String getRelativePath(final File from, final File to) { return getRelativePath(from, to, File.separatorChar); } private  IoFileRelativePathUtil();   }