Changeset 31341
- Timestamp:
- 2017-01-23T22:21:38+13:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/hathitrust/wcsa/vol-checker/src/org/hathitrust/extractedfeatures/VolumeCheck.java
r31340 r31341 165 165 Process proc = runtime.exec(rsync_command); 166 166 proc.waitFor(); 167 System.err.println("*** Rsync finished");167 //System.err.println("*** Rsync finished"); 168 168 169 169 FileInputStream fis = new FileInputStream(json_filename_tail); 170 170 bis = new BufferedInputStream(fis); 171 172 //Path json_filename_path = Paths.get(json_filename_tail);173 //byte[] bz_bytes = Files.readAllBytes(json_filename_path);174 175 176 //response.setContentType("application/json");177 178 /*179 BufferedReader stdInput = new BufferedReader(new180 InputStreamReader(proc.getInputStream()));181 182 BufferedReader stdError = new BufferedReader(new183 InputStreamReader(proc.getErrorStream()));184 185 // read the output from the command186 System.out.println("Here is the standard output of the command:\n");187 String s = null;188 while ((s = stdInput.readLine()) != null) {189 System.out.println(s);190 }191 192 // read any errors from the attempted command193 System.out.println("Here is the standard error of the command (if any):\n");194 while ((s = stdError.readLine()) != null) {195 System.out.println(s);196 }197 */198 199 200 //return bz_bytes;201 //System.out.println("Done.");202 171 203 172 } … … 271 240 response.setHeader("Content-Disposition", "attachment; filename=\"" + json_filename_tail + "\""); 272 241 273 274 //InputStream is=request.getInputStream();275 242 OutputStream os=response.getOutputStream(); 276 243 BufferedOutputStream bos = new BufferedOutputStream(os); … … 278 245 byte[] buf = new byte[1024]; 279 246 280 //int total_num_bytes = 0;281 282 //int num_bytes;283 247 while (true) { 284 248 int num_bytes = bis.read(buf); … … 289 253 //total_num_bytes += num_bytes; 290 254 } 291 292 //System.err.println("*** total num bytes = " + total_num_bytes); 293 294 /* 295 for (int nChunk = bis.read(buf); nChunk!=-1; nChunk = bis.read(buf)) 296 { 297 os.write(buf, 0, nChunk); 298 } 299 */ 300 301 //OutputStream os = response.getOutputStream() 302 303 //os.write(bz_bytes); 304 255 305 256 bis.close(); 306 257 bos.close();
Note:
See TracChangeset
for help on using the changeset viewer.