예제 #1
0
 public static Map<String, Document> getDocuments(ProvideAndRegisterDocumentSetRequestType req) {
   List<Document> docs = req.getDocument();
   Map<String, Document> map = new HashMap<String, Document>(docs.size());
   Document doc;
   for (int i = 0, len = docs.size(); i < len; i++) {
     doc = docs.get(i);
     map.put(doc.getId(), doc);
   }
   return map;
 }
예제 #2
0
 private void logRequest(ProvideAndRegisterDocumentSetRequestType req) {
   log.info("###### SubmitObjectRequest:" + req.getSubmitObjectsRequest());
   List<Document> docs = req.getDocument();
   log.info("###### Documents:" + docs);
   if (docs != null) {
     StringBuilder sb = new StringBuilder();
     sb.append("######Number of Documents:").append(docs.size());
     int dumpValLen;
     for (Document d : docs) {
       sb.append("\nDocument ID:" + d.getId())
           .append("       size:")
           .append(d.getValue().length)
           .append("       value:");
       try {
         dumpValLen = Math.min(d.getValue().length, 40);
         sb.append(new String(d.getValue(), 0, dumpValLen));
         if (dumpValLen == 40) sb.append("...");
       } catch (Exception x) {
         log.warn("Failed to convert value in String!", x);
       }
     }
     log.info(sb.toString());
   }
 }