@@ -0,0 +1,1252 @@
+/** %0A * Copyright (c) 2019 committers of YAKINDU and others. %0A * All rights reserved. This program and the accompanying materials %0A * are made available under the terms of the Eclipse Public License v1.0 %0A * which accompanies this distribution, and is available at %0A * http://www.eclipse.org/legal/epl-v10.html %0A * Contributors:%0A * committers of YAKINDU - initial API and implementation%0A *%0A*/%0Apackage org.yakindu.sct.commons;%0A%0Aimport java.io.File;%0A%0Aimport org.eclipse.core.resources.IFile;%0Aimport org.eclipse.core.resources.ResourcesPlugin;%0Aimport org.eclipse.emf.common.util.URI;%0A%0A/**%0A * @author andreas muelder - Initial contribution and API%0A * %0A */%0Apublic final class EmfURIUtil %7B%0A%09%0A%09private EmfURIUtil() %7B%0A%09%09// intentional%0A%09%7D%0A%0A%09public static IFile toFile(URI emfUri) %7B%0A%09%09if (emfUri.isPlatformResource()) %7B%0A%09%09%09String platformString = emfUri.toPlatformString(true);%0A%09%09%09return (IFile) ResourcesPlugin.getWorkspace().getRoot().findMember(platformString);%0A%09%09%7D else if (emfUri.isFile()) %7B%0A%09%09%09File file = new File(emfUri.toFileString());%0A%09%09%09if (!file.exists())%0A%09%09%09%09return null;%0A%09%09%09IFile%5B%5D files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(file.toURI());%0A%09%09%09if (files.length == 1) %7B%0A%09%09%09%09return files%5B0%5D;%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return null;%0A%09%7D%0A%7D%0A

move URIUtil from Pro to open source project