@Test public void testRelativePath_2_directParent() { final String actual = FileUtil.getRelativePath(new File("/home/john"), new File("/home/john/notes.txt")); Assert.assertEquals("notes.txt", actual); }
public static String getRelativePath(File root, File file) { return new RelativePathBase(root).getRelativePathFor(file); }
FileUtil { public static String getRelativePath(File root, File file) { return new RelativePathBase(root).getRelativePathFor(file); } }
FileUtil { public static String getRelativePath(File root, File file) { return new RelativePathBase(root).getRelativePathFor(file); } private  FileUtil(); }
FileUtil { public static String getRelativePath(File root, File file) { return new RelativePathBase(root).getRelativePathFor(file); } private  FileUtil(); static File getUserDir(); static List<File> toList(File... files); static String getRelativePath(File root, File file); static File toAbsoluteFile(File currentDirectory, File file); static List<String> getPathElements(File file); static List<File> expandFiles(String... paths); static List<File> expandFiles(File currentDirectory, String... paths); static FilenameFilter getFileNameFilter(String name); static boolean isWildcardFileName(String name); static File getOutputDirectoryGivenClass(final Class<?> clazz); static File getDirectoryOfClassFile(Class<?> clazz); static File getDirectoryOfClassFile(final String className); }
FileUtil { public static String getRelativePath(File root, File file) { return new RelativePathBase(root).getRelativePathFor(file); } private  FileUtil(); static File getUserDir(); static List<File> toList(File... files); static String getRelativePath(File root, File file); static File toAbsoluteFile(File currentDirectory, File file); static List<String> getPathElements(File file); static List<File> expandFiles(String... paths); static List<File> expandFiles(File currentDirectory, String... paths); static FilenameFilter getFileNameFilter(String name); static boolean isWildcardFileName(String name); static File getOutputDirectoryGivenClass(final Class<?> clazz); static File getDirectoryOfClassFile(Class<?> clazz); static File getDirectoryOfClassFile(final String className); static final String ROOT_UNIX; static final String ROOT_WINDOWS; static final String ROOT_WINDOWS_NETWORK; static final String ROOT; }