public void fetchFile() throws Exception {
  try {
    while (true) {
      final FastInputStream is=getStream();
      int result;
      try {
        result=fetchPackets(is);
        if (result == 0 || result == NO_CONTENT) {
          return;
        }
      }
  finally {
        IOUtils.closeQuietly(is);
      }
    }
  }
  finally {
    cleanup();
    fsyncService.submit(null);
  }
}

public void fetchFile ( ) throws Exception { try { while ( true ) { final FastInputStream is = getStream ( ) ; int result ; try { result = fetchPackets ( is ) ; if ( result == 0 || result == NO_CONTENT ) { return ; } } finally { IOUtils . closeQuietly ( is ) ; } } } finally { cleanup ( ) ; fsyncService . submit ( null ) ; } }
the main method which downloads file
