/** * This implementation returns the description of this resource. * @see #getDescription() */ @Override public String toString() { return getDescription(); }
/** * This implementation returns the description's hash code. * @see #getDescription() */ @Override public int hashCode() { return getDescription().hashCode(); }
/** * This implementation throws a FileNotFoundException, assuming * that the resource cannot be resolved to a URL. */ @Override public URL getURL() throws IOException { throw new FileNotFoundException(getDescription() + " cannot be resolved to URL"); }
/** * This implementation throws a FileNotFoundException, assuming * that relative resources cannot be created for this resource. */ @Override public Resource createRelative(String relativePath) throws IOException { throw new FileNotFoundException("Cannot create a relative resource for " + getDescription()); }
/** * This implementation throws a FileNotFoundException, assuming * that the resource cannot be resolved to an absolute file path. */ @Override public File getFile() throws IOException { throw new FileNotFoundException(getDescription() + " cannot be resolved to absolute file path"); }
/** * This implementation returns the description of this resource. * @see #getDescription() */ @Override public String toString() { return getDescription(); }
/** * This implementation throws a FileNotFoundException, assuming * that relative resources cannot be created for this resource. */ @Override public Resource createRelative(String relativePath) throws IOException { throw new FileNotFoundException("Cannot create a relative resource for " + getDescription()); }
/** * This implementation returns the description's hash code. * @see #getDescription() */ @Override public int hashCode() { return getDescription().hashCode(); }
/** * This implementation throws a FileNotFoundException, assuming * that the resource cannot be resolved to a URL. */ @Override public URL getURL() throws IOException { throw new FileNotFoundException(getDescription() + " cannot be resolved to URL"); }
/** * This implementation throws a FileNotFoundException, assuming * that the resource cannot be resolved to an absolute file path. */ @Override public File getFile() throws IOException { throw new FileNotFoundException(getDescription() + " cannot be resolved to absolute file path"); }
/** * This implementation compares description strings. * @see #getDescription() */ @Override public boolean equals(Object other) { return (this == other || (other instanceof Resource && ((Resource) other).getDescription().equals(getDescription()))); }
/** * This implementation checks the timestamp of the underlying File, * if available. * @see #getFileForLastModifiedCheck() */ @Override public long lastModified() throws IOException { File fileToCheck = getFileForLastModifiedCheck(); long lastModified = fileToCheck.lastModified(); if (lastModified == 0L && !fileToCheck.exists()) { throw new FileNotFoundException(getDescription() + " cannot be resolved in the file system for checking its last-modified timestamp"); } return lastModified; }
/** * This implementation compares description strings. * @see #getDescription() */ @Override public boolean equals(Object other) { return (this == other || (other instanceof Resource && ((Resource) other).getDescription().equals(getDescription()))); }
/** * This implementation checks the timestamp of the underlying File, * if available. * @see #getFileForLastModifiedCheck() */ @Override public long lastModified() throws IOException { File fileToCheck = getFileForLastModifiedCheck(); long lastModified = fileToCheck.lastModified(); if (lastModified == 0L && !fileToCheck.exists()) { throw new FileNotFoundException(getDescription() + " cannot be resolved in the file system for checking its last-modified timestamp"); } return lastModified; }
/** * This implementation returns the description of this resource. * @see #getDescription() */ @Override public String toString() { return getDescription(); }
/** * This implementation throws a FileNotFoundException, assuming * that relative resources cannot be created for this resource. */ public Resource createRelative(String relativePath) throws IOException { throw new FileNotFoundException("Cannot create a relative resource for " + getDescription()); }
/** * This implementation returns the description's hash code. * @see #getDescription() */ @Override public int hashCode() { return getDescription().hashCode(); }
/** * This implementation throws a FileNotFoundException, assuming * that the resource cannot be resolved to a URL. */ public URL getURL() throws IOException { throw new FileNotFoundException(getDescription() + " cannot be resolved to URL"); }
/** * This implementation throws a FileNotFoundException, assuming * that the resource cannot be resolved to an absolute file path. */ public File getFile() throws IOException { throw new FileNotFoundException(getDescription() + " cannot be resolved to absolute file path"); }
/** * This implementation compares description strings. * @see #getDescription() */ @Override public boolean equals(Object obj) { return (obj == this || (obj instanceof Resource && ((Resource) obj).getDescription().equals(getDescription()))); }