我使用以下代码创建了一个源文件夹:
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;
现在我想将**
添加到其排除路径中,就像在此对话框中一样:
我该怎么做?
答案 0 :(得分:1)
JavaCore.newSourceEntry
的变体支持此功能:
public static IClasspathEntry newSourceEntry(IPath path, IPath[] inclusionPatterns,
IPath[] exclusionPatterns, IPath specificOutputLocation,
IClasspathAttribute[] extraAttributes)