fitgoodies-core/src/main/java/de/cologneintelligence/fitgoodies/file/FileSystemDirectoryHelper.java
public File[] getParentDirs(final File fromDir, final File toDir) throws IOException {
		List<File> result = new LinkedList<>();
		final File fromDirCanonical = fromDir.getCanonicalFile();
		for (File current = toDir.getCanonicalFile().getAbsoluteFile(); !current.equals(fromDirCanonical); current = current.getParentFile()) {
			result.add(0, current);
		}

		return result.toArray(new File[result.size()]);
	}
public File[] getParentDirs(final File fromDir, final File toDir) throws IOException {
		List<File> result = new LinkedList<>();
		final File fromDirCanonical = fromDir.getCanonicalFile();
		for (File current = toDir.getCanonicalFile().getAbsoluteFile(); !current.equals(fromDirCanonical); current = current.getParentFile()) {
			result.add(0, current);
		}

		return result.toArray(new File[result.size()]);
	}
public File [ ] getParentDirs ( final File fromDir , final File toDir ) throws IOException { List < File > result = new LinkedList <> ( ) ; final File fromDirCanonical = fromDir . getCanonicalFile ( ) ; for ( File current = toDir . getCanonicalFile ( ) . getAbsoluteFile ( ) ; ! current . equals ( fromDirCanonical ) ; current = current . getParentFile ( ) ) { result . add ( 0 , current ) ; } return result . toArray ( new File [ result . size ( ) ] ) ; }
Returns all directory paths between {@code fromDir} and {@code toDir}.

@param fromDir directory to start from
@param toDir   last directory path
@return an array of all generated paths
@throws java.io.IOException Thrown when paths cannot be normalized.
Returns all directory paths between { @code fromDir } and { @code toDir } .