Bug 514530 - CCE: UpdateSiteArtifactRepository cannot be cast to
IFileArtifactRepository

In case we are able to load a repository which type doesn't correspond
to the expected IFileArtifactRepository, just return null (and do not
try to create another one at same location).

Change-Id: I0787bc10b02b43def7efdbcfdc9c1221e032629a
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java
index 91812a3..52d27b2 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java
@@ -78,7 +78,12 @@
 			return null;
 		IArtifactRepositoryManager manager = getArtifactRepositoryManager(agent);
 		try {
-			return (IFileArtifactRepository) manager.loadRepository(location, null);
+			IArtifactRepository repository = manager.loadRepository(location, null);
+			if (repository instanceof IFileArtifactRepository) {
+				return (IFileArtifactRepository) repository;
+			}
+			// update site repository
+			return null;
 		} catch (ProvisionException e) {
 			//the repository doesn't exist, so fall through and create a new one
 		}