public List<BreadCrumb> makeBreadCrumbs( final Path path, final List<org.kie.commons.java.nio.file.Path> exclusions, final Map<org.kie.commons.java.nio.file.Path, String> captionSubstitutions ) { final List<BreadCrumb> breadCrumbs = new ArrayList<BreadCrumb>(); org.kie.commons.java.nio.file.Path nioPath = paths.convert( path ); org.kie.commons.java.nio.file.Path nioFileName = nioPath.getFileName(); while ( nioFileName != null ) { if ( includePath( nioPath, exclusions ) ) { String caption = nioFileName.toString(); if ( captionSubstitutions.containsKey( nioPath ) ) { caption = captionSubstitutions.get( nioPath ); } final BreadCrumb breadCrumb = new BreadCrumb( paths.convert( nioPath ), caption ); breadCrumbs.add( 0, breadCrumb ); } nioPath = nioPath.getParent(); nioFileName = nioPath.getFileName(); } breadCrumbs.add( 0, new BreadCrumb( paths.convert( nioPath ), getRootDirectory( nioPath ) ) ); return breadCrumbs; }