code: public String canonicalOrAbsolutePath(String path) {
  
          try {
              return canonicalPath(path);
          } catch (Exception e) {
              return absolutePath(path);
          }
      }
docs: Retrieves the canonical path for the given path, or the absolute
  path if attemting to retrieve the canonical path fails.
  
  @param path the path for which to retrieve the canonical or
  absolute path
  @return the canonical or absolute path