final static long INTERVAL = 500;//milliseconds
@RequestMapping(method=RequestMethod.GET)
public void getDownload(@RequestParam("requestId") String requestId, HttpServletResponse response) throws IOException, InterruptedException {
DownloadRequest layerDownloadRequest = requestStatusManager.getDownloadRequest(UUID.fromString(requestId));
File downloadPackage = layerDownloadRequest.getDownloadPackage();
long counter = 0;
//a final check. should never get here via the client
while (!downloadPackage.exists()){
Thread.sleep(INTERVAL);
counter += INTERVAL;