Java Canonical Path Create getCanonicalPath(File file)

Here you can find the source of getCanonicalPath(File file)

Description

Returns the canonical path to a directory

License

Open Source License

Return

Path to directory

Declaration

public static String getCanonicalPath(File file) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

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

public class Main {
    /**//from   ww w. j ava  2s. c o  m
     * Returns the canonical path to a directory
     *
     * @return Path to directory
     */
    public static String getCanonicalPath(File file) {
        String canonicalPath = "";
        try {
            canonicalPath = file.getCanonicalPath();
        } catch (IOException ignored) {
        }
        return canonicalPath;
    }
}

Related

  1. getCanonicalFileOrNull(@Nullable final File aFile)
  2. getCanonicalFiles2List(List path, String[] allowedExtension)
  3. getCanonicalFileURL(File file)
  4. getCanonicalLocationFilePath(String location, String file)
  5. getCanonicalOrAbsolutePath(File file)
  6. getCanonicalPath(File inFile, boolean inThrowRuntimeException)
  7. getCanonicalPath(final File file)
  8. getCanonicalPath(final File file)
  9. getCanonicalPath(final String path)