b = FileUtils.read(source);
} catch (IOException e1) {
throw new Parser.Failure(e1.toString(), location);
}
final BDecoder bd = new BDecoder(b);
final BObject bo = bd.parse();
if (bo == null) throw new Parser.Failure("BDecoder.parse returned null", location);
if (bo.getType() != BType.dictionary) throw new Parser.Failure("BDecoder object is not a dictionary", location);
final Map<String, BObject> map = bo.getMap();
final BObject commento = map.get("comment");
final String comment = (commento == null) ? "" : UTF8.String(commento.getString());
//Date creation = new Date(map.get("creation date").getInteger());
final BObject infoo = map.get("info");
final StringBuilder filenames = new StringBuilder(80);
String title = "";
if (infoo != null) {
final Map<String, BObject> info = infoo.getMap();
final BObject fileso = info.get("files");
if (fileso != null) {
final List<BObject> filelist = fileso.getList();
for (final BObject fo: filelist) {
final BObject patho = fo.getMap().get("path");
if (patho != null) {
final List<BObject> l = patho.getList(); // one file may have several names
for (final BObject fl: l) {
filenames.append(fl.toString()).append(" ");
}
}
}
}
final BObject nameo = info.get("name");
if (nameo != null) title = UTF8.String(nameo.getString());
}
if (title == null || title.length() == 0) title = MultiProtocolURI.unescape(location.getFileName());
try {
return new Document[]{new Document(
location,