List of utility methods to do Canonical Path Create
String | getCanonicalCharset(String charset) get Canonical Charset return new OutputStreamWriter(DUMMY_OUTPUT_STREAM, charset).getEncoding(); |
String | getCanonicalCharsetQuiet(String charset) get Canonical Charset Quiet try { return getCanonicalCharset(charset); } catch (UnsupportedEncodingException e) { return null; |
String | getCanonicalDirectory(final String rawDir) If the given string is the empty string, then the result is the current directory. String dir = rawDir.length() == 0 ? "." : rawDir; File dd = new File(dir); if (!dd.exists()) { dd.mkdirs(); if (!dir.startsWith("/")) { dir = dd.getCanonicalPath(); return dir; |
File | getCanonicalDirectory(String path, String errPrefix) Retrieves the canonicalized directory from the specified path. File rc; try { rc = new File(path).getCanonicalFile(); } catch (IOException e) { throw new IllegalArgumentException(errPrefix + " '" + path + "' : " + e.getMessage()); if (!rc.exists()) { throw new IllegalArgumentException(errPrefix + " '" + path + "' : does not exist"); ... |
File | getCanonicalFile(@Nullable final File aFile) Get the canonical file of the passed file, if the file is not null .
return aFile == null ? null : aFile.getCanonicalFile();
|
File | getCanonicalFile(File f) get Canonical File try { return f.getCanonicalFile(); } catch (IOException e) { return f.getAbsoluteFile(); |
File | getCanonicalFile(File file) get Canonical File return file.getCanonicalFile();
|
File | getCanonicalFile(File file) get Canonical File try { return file.getCanonicalFile(); } catch (IOException e) { throw new RuntimeException( "Failed to get canonical file for absolute path [" + file.getAbsolutePath() + "].", e); |
File | getCanonicalFile(File file) get Canonical File file = new File(file.getPath()); File result; try { result = file.getAbsoluteFile().getCanonicalFile(); } catch (IOException e) { result = file.getAbsoluteFile(); return result; ... |
File | getCanonicalFile(File file) get Canonical File if (file == null) throw new IllegalArgumentException("file must not be null."); try { return (file.getCanonicalFile()); } catch (IOException e) { return (file.getAbsoluteFile()); |