code: public File getCanonicalFile(final File file) throws IOException {
          if (System.getSecurityManager() == null)
              return file.getCanonicalFile();
          try {
              return AccessController.doPrivileged(new PrivilegedExceptionAction<File>() {
                  @Override
                  public File run() throws IOException {
                      return file.getCanonicalFile();
                  }
              }, controlContext);
          } catch (PrivilegedActionException e) {
              if (e.getException() instanceof IOException)
                  throw (IOException) e.getException();
              throw (RuntimeException) e.getException();
          }
      }
docs: Returns the canonical file. Same as calling
  file.getCanonicalFile().
  
  @param file a file object
  @return the canonical file.