Ejemplo n.º 1
0
 public void processRecords(List<String> records)
     throws MalformedURLException, ProtocolException, IOException {
   HttpURLConnection urlConn = null;
   String request = istexApiUrl;
   System.out.println(records.size());
   for (String id : records) {
     request = istexApiUrl + "/" + id + "/fulltext/tei";
     URL url = new URL(request);
     urlConn = (HttpURLConnection) url.openConnection();
     System.out.println(" id :" + id);
     if (urlConn != null) {
       urlConn.setDoInput(true);
       urlConn.setRequestMethod("GET");
       InputStream in = urlConn.getInputStream();
       String xml = Utilities.convertStreamToString(in);
       mm.insertExternalTeiDocument(in, id, "istex", MongoCollectionsInterface.ISTEX_TEIS, date);
       in.close();
     }
   }
 }
Ejemplo n.º 2
0
 public IstexHarvester() {
   this.mm = MongoFileManager.getInstance(false);
 }