示例#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();
 }