OW2 Util

FileUtils should provide convenience close() and flush() methods

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: OW2 Util 1.0.19
  • Component/s: None
  • Description:
    Hide
    When closing or flushing a file, a stream, the same old actions are always done:
    if (object != null) {
      try {
        object.close();
      } catch {
        // Ignored
      }
    }

    Having a convenience method could simplify the code dealing with close and flush.

    Proposed methods signatures:
    FileUtils.close(Closeable... closeables);
    FileUtils.close(Flusheable... flusheables);

    WDYT ?
    Show
    When closing or flushing a file, a stream, the same old actions are always done: if (object != null) {   try {     object.close();   } catch {     // Ignored   } } Having a convenience method could simplify the code dealing with close and flush. Proposed methods signatures: FileUtils.close(Closeable... closeables); FileUtils.close(Flusheable... flusheables); WDYT ?

Activity

Hide
Guillaume Sauthier added a comment - 13/Aug/09 2:02 PM
Added in trunk
Show
Guillaume Sauthier added a comment - 13/Aug/09 2:02 PM Added in trunk

People

Dates

  • Created:
    13/Aug/09 10:18 AM
    Updated:
    13/Aug/09 2:03 PM
    Resolved:
    13/Aug/09 2:02 PM