@Test public void testGetRelativePathFromInnerDirectory() { RelativePathResolver tested = new RelativePathResolver(); String relativePathToFile = tested.getRelativePathToFile("first/file1.bin", "first/third/file2.bin"); Assert.assertEquals("third/file2.bin", relativePathToFile); }
public String getRelativePathToFile(String callerPath, String targetPath) { LinkedList<String> callerPathElements = getLinkedListOfPathElements(callerPath); LinkedList<String> targetPathElements = getLinkedListOfPathElements(targetPath); List<String> relativePathToFile = getRelativePathToFile(callerPathElements, targetPathElements); return generateRelativePathString(relativePathToFile); }
RelativePathResolver { public String getRelativePathToFile(String callerPath, String targetPath) { LinkedList<String> callerPathElements = getLinkedListOfPathElements(callerPath); LinkedList<String> targetPathElements = getLinkedListOfPathElements(targetPath); List<String> relativePathToFile = getRelativePathToFile(callerPathElements, targetPathElements); return generateRelativePathString(relativePathToFile); } }
RelativePathResolver { public String getRelativePathToFile(String callerPath, String targetPath) { LinkedList<String> callerPathElements = getLinkedListOfPathElements(callerPath); LinkedList<String> targetPathElements = getLinkedListOfPathElements(targetPath); List<String> relativePathToFile = getRelativePathToFile(callerPathElements, targetPathElements); return generateRelativePathString(relativePathToFile); }  }
RelativePathResolver { public String getRelativePathToFile(String callerPath, String targetPath) { LinkedList<String> callerPathElements = getLinkedListOfPathElements(callerPath); LinkedList<String> targetPathElements = getLinkedListOfPathElements(targetPath); List<String> relativePathToFile = getRelativePathToFile(callerPathElements, targetPathElements); return generateRelativePathString(relativePathToFile); }  String getRelativePathAsFile(Class originClass,Class targetClass, String extension); String getRelativePathToFile(String callerPath, String targetPath); String getPathOf(Class aClass, String extension); }
RelativePathResolver { public String getRelativePathToFile(String callerPath, String targetPath) { LinkedList<String> callerPathElements = getLinkedListOfPathElements(callerPath); LinkedList<String> targetPathElements = getLinkedListOfPathElements(targetPath); List<String> relativePathToFile = getRelativePathToFile(callerPathElements, targetPathElements); return generateRelativePathString(relativePathToFile); }  String getRelativePathAsFile(Class originClass,Class targetClass, String extension); String getRelativePathToFile(String callerPath, String targetPath); String getPathOf(Class aClass, String extension);  }