globalModule.getSourcePath().stream() .map( IResource::toJavaFile ) .filter( f -> !SourcePathUtil.excludeFromSourcePath( f.getAbsolutePath() ) )
private String getTypeForFile( JavaFileObject file ) { URI uri = file.toUri(); if( !uri.getScheme().equalsIgnoreCase( "file" ) ) { return makeTypeName( file.getName() ); } IFile iFile = getHost().getFileSystem().getIFile( new File( file.getName() ) ); List<IDirectory> sourcePath = getHost().getSingleModule().getSourcePath(); for( IDirectory dir : sourcePath ) { if( iFile.isDescendantOf( dir ) ) { return makeTypeName( iFile.getName().substring( dir.getName().length() ) ); } } throw new IllegalStateException( "Could not infer type name from: " + file.getName() ); }