private static boolean addClassesForFolder(IFolder folder, Map<IPath, IPath> outLocations, Project fbProject) {
        IPath path = folder.getLocation();
        IPath srcRoot = getMatchingSourceRoot(path, outLocations);
        if (srcRoot == null) {
            return false;
        }
        IPath outputRoot = outLocations.get(srcRoot);
        int firstSegments = path.matchingFirstSegments(srcRoot);
        // add relative path to the output path
        IPath out = outputRoot.append(path.removeFirstSegments(firstSegments));
        File directory = out.toFile();
        return fbProject.addFile(directory.getAbsolutePath());
        // TODO child directories too. Should add preference???
    }
private static boolean addClassesForFolder ( IFolder folder , Map < IPath , IPath > outLocations , Project fbProject ) { IPath path = folder . getLocation ( ) ; IPath srcRoot = getMatchingSourceRoot ( path , outLocations ) ; if ( srcRoot == null ) { return false ; } IPath outputRoot = outLocations . get ( srcRoot ) ; int firstSegments = path . matchingFirstSegments ( srcRoot ) ; IPath out = outputRoot . append ( path . removeFirstSegments ( firstSegments ) ) ; File directory = out . toFile ( ) ; return fbProject . addFile ( directory . getAbsolutePath ( ) ) ; }
@return false if no classes was added