Java Canonical Path Create getCanonicalPath(IPath fullPath)

Here you can find the source of getCanonicalPath(IPath fullPath)

Description

get Canonical Path

License

Open Source License

Declaration

public static IPath getCanonicalPath(IPath fullPath) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2004, 2009 QNX Software Systems 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://w  ww  .  j  a  v  a  2 s .  c  o m
 *     QNX Software Systems - initial API and implementation
 *     Markus Schorn (Wind River Systems)
 *******************************************************************************/

import java.io.File;
import java.io.IOException;

import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;

public class Main {
    public static IPath getCanonicalPath(IPath fullPath) {
        File file = fullPath.toFile();
        try {
            String canonPath = file.getCanonicalPath();
            return new Path(canonPath);
        } catch (IOException ex) {
        }
        return null;
    }
}

Related

  1. getCanonicalPath(File file)
  2. getCanonicalPath(File inFile, boolean inThrowRuntimeException)
  3. getCanonicalPath(final File file)
  4. getCanonicalPath(final File file)
  5. getCanonicalPath(final String path)
  6. getCanonicalPath(IPath fullPath)
  7. getCanonicalPath(String basePath, String path)
  8. getCanonicalPath(String filePath, String prefix)
  9. getCanonicalPath(String inPath)