Ignore:
Timestamp:
2017-01-23T22:21:38+13:00 (7 years ago)
Author:
davidb
Message:

Cody tidy-up

File:
1 edited

Legend:

Unmodified
Added
Removed
  • other-projects/hathitrust/wcsa/vol-checker/src/org/hathitrust/extractedfeatures/VolumeCheck.java

    r31340 r31341  
    165165            Process proc = runtime.exec(rsync_command);
    166166            proc.waitFor();
    167             System.err.println("*** Rsync finished");
     167            //System.err.println("*** Rsync finished");
    168168       
    169169            FileInputStream fis = new FileInputStream(json_filename_tail);
    170170            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(new
    180                     InputStreamReader(proc.getInputStream()));
    181 
    182             BufferedReader stdError = new BufferedReader(new
    183                     InputStreamReader(proc.getErrorStream()));
    184 
    185             // read the output from the command
    186             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 command
    193             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.");
    202171             
    203172        }
     
    271240                    response.setHeader("Content-Disposition", "attachment; filename=\"" + json_filename_tail + "\"");
    272241
    273                    
    274                     //InputStream is=request.getInputStream();
    275242                    OutputStream os=response.getOutputStream();
    276243                    BufferedOutputStream bos = new BufferedOutputStream(os);
     
    278245                    byte[] buf = new byte[1024];
    279246                   
    280                     //int total_num_bytes = 0;
    281                    
    282                     //int num_bytes;
    283247                    while (true) {
    284248                        int num_bytes = bis.read(buf);
     
    289253                        //total_num_bytes += num_bytes;
    290254                    }
    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                                       
    305256                    bis.close();
    306257                    bos.close();
Note: See TracChangeset for help on using the changeset viewer.