use of org.apache.sling.ide.eclipse.core.internal.ResourceAndInfo in project sling by apache.
the class ImportRepositoryContentAction method recordNotIgnoredResources.
private void recordNotIgnoredResources() throws CoreException {
final ResourceChangeCommandFactory rccf = new ResourceChangeCommandFactory(serializationManager, Activator.getDefault().getPreferences().getIgnoredFileNamesForSync());
IResource importStartingPoint = contentSyncRootDir.findMember(repositoryImportRoot);
if (importStartingPoint == null) {
return;
}
importStartingPoint.accept(new IResourceVisitor() {
@Override
public boolean visit(IResource resource) throws CoreException {
try {
ResourceAndInfo rai = rccf.buildResourceAndInfo(resource, repository);
if (rai == null) {
// can be a prerequisite
return true;
}
String repositoryPath = rai.getResource().getPath();
FilterResult filterResult = filter.filter(repositoryPath);
if (ignoredResources.isIgnored(repositoryPath)) {
return false;
}
if (filterResult == FilterResult.ALLOW) {
currentResources.add(resource);
return true;
}
return false;
} catch (IOException e) {
throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Failed reading current project's resources", e));
}
}
});
logger.trace("Found {0} not ignored local resources", currentResources.size());
}
Aggregations