protected void extractFile(GFile srcFile, File outputFile, TaskMonitor monitor)
			throws CancelledException {

		monitor.setMessage(srcFile.getName());
		try (InputStream in = getSourceFileInputStream(srcFile, monitor)) {
			if (in != null) {
				try (OutputStream out = new FileOutputStream(outputFile)) {
					long bytesCopied = FileUtilities.copyStreamToStream(in, out, monitor);
					// only check the bytes copied if the file knows its length. If -1, just allow anything.
					if (srcFile.getLength() != -1 && bytesCopied != srcFile.getLength()) {
						throw new IOException("Failed to copy the correct number of bytes from " +
							srcFile.getFSRL() + " to " + outputFile + ".  Expected " +
							srcFile.getLength() + ", bytes copied " + bytesCopied);
					}
					totalBytesExportedCount += bytesCopied;
					totalFilesExportedCount++;
				}
			}
		}
		catch (IOException e) {
			Msg.error(this, "Error when copying file " + srcFile.getFSRL() + " to " + outputFile,
				e);
		}
	}
Allows custom handling of exceptions that occur during file extraction.
<p>
Return true if the exception should be ignored by the file extraction process,
otherwise return false if it should be propagated up the call stack.

@param file file that was being extracted when the exception happened
@param e the exception
@return true if the exception should be suppressed, false if the exception should
be thrown
Ghidra/Features/Base/src/main/java/ghidra/formats/gfilesystem/AbstractFileExtractorTask.java