TDI-30302: review util functions to help for the junits
This commit is contained in:
@@ -28,9 +28,11 @@ public class ResourceUtil {
|
||||
|
||||
private static final String BUNDLERESOURCE = "bundleresource"; //$NON-NLS-1$
|
||||
|
||||
private static final String BUNDLEENTRY = "bundleentry"; //$NON-NLS-1$
|
||||
|
||||
public static File convertResourceToFile(URL resource) throws IOException, URISyntaxException {
|
||||
File fileDir = null;
|
||||
if (BUNDLERESOURCE.equals(resource.getProtocol())) {
|
||||
if (BUNDLERESOURCE.equals(resource.getProtocol()) || BUNDLEENTRY.equals(resource.getProtocol())) {
|
||||
URL unescapedURL = FileLocator.toFileURL(resource);
|
||||
URI escapedURI = new URI(unescapedURL.getProtocol(), unescapedURL.getPath(), unescapedURL.getQuery());
|
||||
fileDir = URIUtil.toFile(escapedURI);
|
||||
|
||||
@@ -14,6 +14,7 @@ package org.talend.repository.viewer.content;
|
||||
|
||||
import org.eclipse.core.resources.IContainer;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.resources.IResourceDelta;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
@@ -93,6 +94,9 @@ public class VisitResourceHelper {
|
||||
IResourceDelta[] affectedChildren = delta.getAffectedChildren();
|
||||
|
||||
IResource res = delta.getResource();
|
||||
if (res instanceof IProject && delta.getKind() == IResourceDelta.REMOVED) {
|
||||
return false;
|
||||
}
|
||||
IPath path = delta.getFullPath();
|
||||
|
||||
boolean noChild = (affectedChildren == null || (affectedChildren.length == 0));
|
||||
|
||||
Reference in New Issue
Block a user