code: protected final OutputStream getOutputStreamToFile(final File target, final boolean overwrite)
          throws FileExistsException {
          // Precondition checks
          if (target == null) {
              throw new IllegalArgumentException("Target file must be specified");
          }
          if (target.isDirectory()) {
              throw new IllegalArgumentException("Cannot export a stream file to existing directory: "
                  + target.getAbsolutePath());
          }
          // If target exists and we're not allowed to overwrite it
          if (target.exists() && !overwrite) {
              throw new FileExistsException("Target exists and we haven't been flagged to overwrite it: "
                  + target.getAbsolutePath());
          }
  
          // Get Stream
          final OutputStream out;
          try {
              out = new FileOutputStream(target);
          } catch (final FileNotFoundException e) {
              throw new ArchiveExportException("File could not be created: " + target);
          }
  
          // Return
          return out;
      }
docs: Obtains an {@link OutputStream} to the provided {@link File}.
  
  @param target
  @param overwrite
  Whether we may overwrite an existing file
  @return
  @throws FileExistsException
  If the specified file exists and the overwrite flag is false
  @throws IllegalArgumentException
  If the file target is not specified