List of utility methods to do Canonical Path Create
String | getCanonicalOrAbsolutePath(File file) Provides the canonical path of a file, or its absolute path, if it's not possible to provide the canonical path. try { return file.getCanonicalPath(); } catch (IOException ioe) { return file.getAbsolutePath(); |
String | getCanonicalPath(File file) Returns the canonical path to a directory String canonicalPath = ""; try { canonicalPath = file.getCanonicalPath(); } catch (IOException ignored) { return canonicalPath; |
String | getCanonicalPath(File inFile, boolean inThrowRuntimeException) get Canonical Path try { return inFile.getCanonicalPath(); } catch (final IOException e) { if (inThrowRuntimeException) { throw new RuntimeException(inFile == null ? "File is null" : e.getMessage(), e); return null; |
String | getCanonicalPath(final File file) Get file canonical path in privileged mode. try { return file.getCanonicalPath(); } catch (IOException pae) { throw new IOException(); } catch (RuntimeException pae) { throw new RuntimeException(); |
String | getCanonicalPath(final File file) get Canonical Path try { return file.getCanonicalPath(); } catch (final IOException e) { return file.getAbsolutePath(); |
String | getCanonicalPath(final String path) get Canonical Path try { return (new File(path)).getCanonicalPath(); } catch (Throwable ignored) { return path; |
IPath | getCanonicalPath(IPath fullPath) Return the canonical path (or the passed in path, if one couldn't be found). if (!fullPath.isAbsolute()) return fullPath; File file = fullPath.toFile(); try { String canonPath = file.getCanonicalPath(); IPath canonicalPath = new Path(canonPath); if (fullPath.getDevice() == null) canonicalPath = canonicalPath.setDevice(null); ... |
IPath | getCanonicalPath(IPath fullPath) get Canonical Path File file = fullPath.toFile(); try { String canonPath = file.getCanonicalPath(); return new Path(canonPath); } catch (IOException ex) { return null; |
String | getCanonicalPath(String basePath, String path) Get the canonical path from the basePath and relative path. File found = null; if (!(new File(path).isAbsolute())) { found = new File(basePath, path); } else { found = new File(path); return found.getCanonicalPath(); |
String | getCanonicalPath(String filePath, String prefix) get Canonical Path if (prefix == null || filePath.equals(prefix) || !filePath.startsWith(prefix)) { return filePath; int startIndex = prefix.length(); if (filePath.charAt(startIndex) == File.separatorChar) { startIndex++; return filePath.substring(startIndex); ... |