コード例 #1
0
 /**
  * Indicates that skipped entries should be written to the provided output stream. Note that this
  * does not apply to entries that are rejected because they are invalid (e.g., are malformed or
  * don't conform to schema requirements), but only apply to entries that are skipped because they
  * matched exclude criteria.
  *
  * @param outputStream The output stream to which skipped entries should be written.
  */
 public void writeSkippedEntries(OutputStream outputStream) {
   if (outputStream == null) {
     closeSkipWriter();
     return;
   }
   skipWriter = new BufferedWriter(new OutputStreamWriter(outputStream));
 }
コード例 #2
0
  /**
   * Indicates that skipped entries should be written to the specified file. Note that this applies
   * only to entries that are skipped because they matched exclude criteria.
   *
   * @param skipFile The path to the file to which skipped information should be written.
   * @param existingFileBehavior Indicates how to treat an existing file.
   * @throws IOException If a problem occurs while opening the skip file for writing.
   */
  public void writeSkippedEntries(String skipFile, ExistingFileBehavior existingFileBehavior)
      throws IOException {
    if (skipFile == null) {
      closeSkipWriter();
      return;
    }

    final BufferedWriter writer =
        newBufferedWriter(skipFile, existingFileBehavior, ERR_SKIP_FILE_EXISTS);
    if (writer != null) {
      skipWriter = writer;
    }
  }