Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Fetching a single blob:

Code Block
Resource stream = Resource.createUriRef("urn:stream");
BlobFetcher bf = new BlobFetcher();
bf.setSubject(TimeAnnotatedResource.create(stream,
                         TemporalAnnotation.getInstant(2)));
context.perform(bf);
//read the data and do something with it
processBlob(bf.getInputStream());

Fetching blobs in an interval:

Code Block
Resource stream = Resource.createUriRef("urn:stream");
TimeAnnotatedBlobFetcher bf = new TimeAnnotatedBlobFetcher(
                            TimeAnnotatedResource.create(stream,
                                TemporalAnnotation.getInterval(0,100 )));
context.perform(bf);
for(Pair<TemporalAnnotation,InputStream> blob:bf){
    //read the data and do something with it
    TemporalAnnotation time = blob._1;
    InputStream data = blob._2;
    ...
}