if (!downloadedFile.exists()) {
throw new FileNotFoundException("File to download [" + destinationFileLocation + "] does not exist");
}
if (downloadedFile.length() == 0) {
throw new EmptyFileException("Downloaded file [" + destinationFileLocation + "] is empty");
}
} finally {
// Close the stream if there was an error thrown from downloadPackageBits
try {
bufferedOutput.close();