Question

I created a source folder with following code:

Folder folder = proj.getFolder("resources");
folder.create(false, true, null);
IPackageFragmentRoot root = jproject.getPackageFragmentRoot(folder);
IClasspathEntry[] oldEntries = jproject.getRawClasspath();
IClasspathEntry[] newEntries = new IClasspathEntry[oldEntries.length + 1];
System.arraycopy(oldEntries, 0, newEntries, 0, oldEntries.length);
newEntries[oldEntries.length] = JavaCore.newSourceEntry(root.getPath());
jproject.setRawClasspath(newEntries, null);
i18Resource = folder;

Now I'd like to add ** to its exclusion path like in this dialog:

enter image description here

How can I do it?

Was it helpful?

Solution

There is a variant of JavaCore.newSourceEntry that supports this:

public static IClasspathEntry newSourceEntry(IPath path, IPath[] inclusionPatterns,
       IPath[] exclusionPatterns, IPath specificOutputLocation, 
       IClasspathAttribute[] extraAttributes)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top