Example #1
0
  public InputStream getInputStream() throws IOException {
    InputStream istream = resource.getInputStream();

    if (istream == null) {
      throw new IOException(getDescription() + " cannot be resolved as InputStream");
    }

    return istream;
  }
Example #2
0
  @Override
  public File getFile() throws IOException {
    File file = resource.getFile();

    if (file == null) {
      throw new IOException(getDescription() + " cannot be resolved as File");
    }

    return file;
  }
Example #3
0
  @Override
  public URL getURL() throws IOException {
    URL url = resource.getURL();

    if (url == null) {
      throw new IOException(getDescription() + " cannot be resolved as URL");
    }

    return url;
  }
Example #4
0
  @Override
  public boolean equals(Object obj) {
    if (this == obj) {
      return true;
    }

    if (getClass() != obj.getClass()) {
      return false;
    }

    ResourceAdapter other = (ResourceAdapter) obj;

    if (resource == null) {
      if (other.resource != null) {
        return false;
      }
    } else if (!resource.equals(other.resource)) {
      return false;
    }

    return true;
  }
Example #5
0
 @Override
 public boolean exists() {
   return resource.exists();
 }
Example #6
0
 @Override
 public int hashCode() {
   return 31 + (resource == null ? 0 : resource.hashCode());
 }
Example #7
0
 @Override
 public long lastModified() {
   return resource.lastModified();
 }