// add relative path to the output path
IPath out = outputRoot.append(path.removeFirstSegments(firstSegments));
String fileName = path.removeFileExtension().lastSegment();
String namePattern = fileName + "\\.class|" + fileName + "\\$.*\\.class";
namePattern = addSecondaryTypesToPattern(file, fileName, namePattern);
File directory = out.removeLastSegments(1).toFile();
// add parent folder and regexp for file names
Pattern classNamesPattern = Pattern.compile(namePattern);
ResourceUtils.addFiles(fbProject, directory, classNamesPattern);
}