@Override public int hashCode() { return Arrays.hashCode(new Object[] { getStreamSource(), mimeType, getFilename(), getBufferSize(), getCacheTime() }); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } else if (obj instanceof StreamResource) { StreamResource that = (StreamResource) obj; return SharedUtil.equals(getStreamSource(), that.getStreamSource()) && SharedUtil.equals(mimeType, that.mimeType) && SharedUtil.equals(getFilename(), that.getFilename()) && getBufferSize() == that.getBufferSize() && getCacheTime() == that.getCacheTime(); } else { return false; } }
@Override public DownloadStream getStream() { final StreamSource ss = getStreamSource(); if (ss == null) { return null; } final DownloadStream ds = new DownloadStream(ss.getStream(), getMIMEType(), getFilename()); ds.setBufferSize(getBufferSize()); ds.setCacheTime(getCacheTime()); return ds; }
@Override public TempFileStreamSource getStreamSource() { return (TempFileStreamSource) super.getStreamSource(); }