while (subjectIter.hasNext()) {
Resource infoDiscoResource = subjectIter.nextResource();
RDFNode infoBitNode = infoDiscoResource.getProperty(
DISCOBITS.infoBit).getObject();
if (infoBitNode instanceof Literal) {
final Literal literaInfoBit = (Literal) infoBitNode;
infoDiscoBitURIs.put(infoDiscoResource.getURI(),
new InfoBit() {
public MessageBody getContent() {
return new MessageBody2Read() {
public ReadableByteChannel read()
throws IOException {
// TODO Auto-generated method
// stub
return Channels
.newChannel(new ByteArrayInputStream(
literaInfoBit
.getString()
.getBytes(
"utf-8")));
}
};
}
public String getMimeTypeString() {
return "application/xhtml+xml";
}
});
} else {
final Resource literaInfoBit = (Resource) infoBitNode;
infoDiscoBitURIs.put(infoDiscoResource.getURI(),
new InfoBit() {
public MessageBody getContent() {
return new MessageBody2Read() {
public ReadableByteChannel read()
throws IOException {
// TODO Auto-generated method
// stub
return Channels
.newChannel(new ByteArrayInputStream(
(byte[]) literaInfoBit.getRequiredProperty(DISCOBITS.bytes).getLiteral().getValue()
));
}
};
}
public String getMimeTypeString() {
return literaInfoBit.getRequiredProperty(DISCOBITS.mediaType).getString();
}
});
}
}