/**
 * Copyright (c) 2018 committers of YAKINDU and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * Contributors:
 * 	committers of YAKINDU - initial API and implementation
 *
 */
package org.yakindu.sct.commons;

import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Objects;

import org.eclipse.core.resources.IFile;
import org.eclipse.emf.common.util.URI;

public class PathHelper {
	public String toPathString(File file) {
		try {
			return file.getCanonicalPath();
		} catch (IOException e) {
			e.printStackTrace();
			return file.getAbsolutePath();
		}
	}

	public Path toPath(String pathString) {
		if (pathString == null) {
			return null;
		}
		Path path = Paths.get(pathString);
		try {
			return path.toRealPath();
		} catch (IOException e) {
			e.printStackTrace();
			return path;
		}
	}
	
	public Path toPath(URI uri) {
		return toPath(uri.toFileString());
	}

	public Path toPath(IFile file) {
		return toPath(file.getLocation().toOSString());
	}

	public boolean pathsEqual(String p1, String p2) {
		Path path1 = toPath(p1);
		Path path2 = toPath(p2);
		return pathsEqual(path1, path2);
	}

	public boolean pathsEqual(Path p1, Path p2) {
		return Objects.equals(p1, p2);
	}
}
@@ -465,16 +465,49 @@
 eption;%0A
+import java.nio.file.LinkOption;%0A
 import j
@@ -903,16 +903,39 @@
 thString
+, LinkOption... options
 ) %7B%0A%09%09if
@@ -1045,24 +1045,31 @@
 .toRealPath(
+options
 );%0A%09%09%7D catch
@@ -1163,16 +1163,39 @@
 (URI uri
+, LinkOption... options
 ) %7B%0A%09%09re
@@ -1216,32 +1216,41 @@
 i.toFileString()
+, options
 );%0A%09%7D%0A%0A%09public P
@@ -1266,24 +1266,47 @@
 h(IFile file
+, LinkOption... options
 ) %7B%0A%09%09return
@@ -1344,16 +1344,25 @@
 String()
+, options
 );%0A%09%7D%0A%0A%09

Add link options for disabling automatic symbol link resolution (#2670)