List of utility methods to do Canonical Path Create
File | getCanonicalFile(File inFile) Will return absolute file if not possible to determine the canonical file. return getCanonicalFile(inFile, false);
|
File | getCanonicalFile(final File file) Gets the the canonical version of the abstract path. return new File(file.getCanonicalPath()); |
File | getCanonicalFile(final File file) Returns the canonical file for the file without throwing a checked exception. if (file == null) { return null; try { return file.getCanonicalFile(); } catch (final IOException ex) { throw new RuntimeException("Couldn't get canonical file for: " + file, ex); |
File | getCanonicalFile(final File file) Devuelve el fichero en su forma canónica. try { return file.getCanonicalFile(); } catch (final IOException e) { LOGGER.severe("No se ha podido obtener el fichero canonico: " + e ); return file; |
File | getCanonicalFileEL(File file) Returns the canonical form of this abstract pathname. try { return file.getCanonicalFile(); } catch (IOException e) { return file; |
String | getCanonicalFileName(String filename) get Canonical File Name String canonicalFileName = filename; try { canonicalFileName = new File(filename).getCanonicalPath(); } catch (IOException ignore) { return canonicalFileName; |
File | getCanonicalFileOrNull(@Nullable final File aFile) Get the canonical file of the passed file, if the file is not null .
try { return getCanonicalFile(aFile); } catch (final IOException ex) { return null; |
List | getCanonicalFiles2List(List get Canonical Files List List<String> r = new ArrayList<String>(); for (String p : path) { List<String> r2 = new ArrayList<String>(); File rfolder = new File(p); if (rfolder.exists() && rfolder.isDirectory()) { File[] files = rfolder.listFiles(); for (File f : files) { if (f.isFile() && !f.getName().startsWith(".")) { ... |
String | getCanonicalFileURL(File file) Solution for JVM bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6351751 String path = file.getAbsoluteFile().getPath(); if (File.separatorChar != '/') { path = path.replace(File.separatorChar, '/'); if (!path.startsWith("//")) { if (path.startsWith("/")) { path = "//" + path; } else { ... |
String | getCanonicalLocationFilePath(String location, String file) get Canonical Location File Path return new File(location, file).getCanonicalPath(); |