Ejemplo n.º 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;
  }
Ejemplo n.º 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;
  }
Ejemplo n.º 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;
  }
Ejemplo n.º 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;
  }
Ejemplo n.º 5
0
 @Override
 public boolean exists() {
   return resource.exists();
 }
Ejemplo n.º 6
0
 @Override
 public int hashCode() {
   return 31 + (resource == null ? 0 : resource.hashCode());
 }
Ejemplo n.º 7
0
 @Override
 public long lastModified() {
   return resource.lastModified();
 }