if(UtilMethods.isSet( integrityDataGeneratorStatus )) {
switch (integrityDataGeneratorStatus) {
case PROCESSING:
return Response.status(HttpStatus.SC_PROCESSING).build();
case FINISHED:
StreamingOutput output = new StreamingOutput() {
public void write(OutputStream output) throws IOException, WebApplicationException {
InputStream is = new FileInputStream(ConfigUtils.getIntegrityPath() + File.separator + requesterEndPoint.getId() + File.separator + INTEGRITY_DATA_TO_CHECK_ZIP_FILE_NAME);
byte[] buffer = new byte[1024];
int bytesRead;
//read from is to buffer
while((bytesRead = is.read(buffer)) !=-1){
output.write(buffer, 0, bytesRead);
}
is.close();
//flush OutputStream to write any buffered data to file
output.flush();
output.close();
}
};
return Response.ok(output).build();