use of eu.transkribus.core.model.beans.DocumentUploadDescriptor in project TranskribusCore by Transkribus.
the class TrpDocUploadBuilder method build.
public static DocumentUploadDescriptor build(TrpDoc doc) {
if (doc == null) {
throw new IllegalArgumentException("doc is null.");
}
if (doc.getMd().getLocalFolder() == null) {
throw new IllegalArgumentException("doc is no localdocument.");
}
if (doc.getNPages() < 1) {
throw new IllegalArgumentException("doc has no pages.");
}
DocumentUploadDescriptor s = new DocumentUploadDescriptor();
s.setMd(doc.getMd());
for (TrpPage p : doc.getPages()) {
s.getPages().add(buildPageUploadDescriptor(p));
}
return s;
}
Aggregations