Java Canonical Path Create getCanonicalPath(File inFile, boolean inThrowRuntimeException)

Here you can find the source of getCanonicalPath(File inFile, boolean inThrowRuntimeException)

Description

get Canonical Path

License

Open Source License

Declaration

public static String getCanonicalPath(File inFile, boolean inThrowRuntimeException) 

Method Source Code

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

import java.io.File;

import java.io.IOException;

public class Main {
    public static String getCanonicalPath(File inFile, boolean inThrowRuntimeException) {

        try {/*from   w  ww  .j a  v  a 2 s.c o  m*/
            return inFile.getCanonicalPath();
        } catch (final IOException e) {

            if (inThrowRuntimeException) {
                throw new RuntimeException(inFile == null ? "File is null" : e.getMessage(), e);
            }

            return null;
        }
    }
}

Related

  1. getCanonicalFiles2List(List path, String[] allowedExtension)
  2. getCanonicalFileURL(File file)
  3. getCanonicalLocationFilePath(String location, String file)
  4. getCanonicalOrAbsolutePath(File file)
  5. getCanonicalPath(File file)
  6. getCanonicalPath(final File file)
  7. getCanonicalPath(final File file)
  8. getCanonicalPath(final String path)
  9. getCanonicalPath(IPath fullPath)