I use the UIL lib in my app, I get the images from my Amazon S3 server.
I've overridden the BaseImageDownloader
class :
protected InputStream getStreamFromOtherSource(String imageId, Object extra)
throws IOException {
TransferManager manager = AmazonParams.getTransferManager();
File file = null;
GetObjectRequest req = new GetObjectRequest(AmazonParams.BUCKET, imageId);
try{
file = ImageLoader.getInstance().getDiscCache().get(imageId);
Download d = manager.download(req, file);
while (d.isDone() == false);
}catch (Exception e){
return null;
}
return new FileInputStream(file);
}
but when I have a 404 error at the server (no such image) the UIL, and I return null
the UIL keeps retrying to load the image over and over. If there is no such image I'd like it not to try again.