Java Canonical Path Create getCanonicalPath(String path)

Here you can find the source of getCanonicalPath(String path)

Description

Returns canonical file path for the given file path

License

Apache License

Parameter

Parameter Description
path Absolute or relative file path

Exception

Parameter Description

Return

Canonical file path

Declaration

public static String getCanonicalPath(String path) throws IOException 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.io.*;

public class Main {
    /**/*from  w w w .j av a2 s .  com*/
     * Returns canonical file path for the given file path
     *
     * @param path Absolute or relative file path
     * @return Canonical file path
     * @throws java.io.IOException Thrown if canonical file path could not be resolved
     */
    public static String getCanonicalPath(String path) throws IOException {
        return new File(path).getCanonicalPath();
    }
}

Related

  1. getCanonicalPath(String path)
  2. getCanonicalPath(String path)
  3. getCanonicalPath(String path)
  4. getCanonicalPath(String path)
  5. getCanonicalPath(String path)
  6. getCanonicalPath(String path)
  7. getCanonicalPath(String path)
  8. getCanonicalPath(String s)
  9. getCanonicalPathIfPossible(java.io.File file)