Пример #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;
  }
Пример #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;
  }
Пример #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;
  }
Пример #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;
  }
Пример #5
0
 @Override
 public boolean exists() {
   return resource.exists();
 }
Пример #6
0
 @Override
 public int hashCode() {
   return 31 + (resource == null ? 0 : resource.hashCode());
 }
Пример #7
0
 @Override
 public long lastModified() {
   return resource.lastModified();
 }