Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 348190 - Provide a utility method that closes a stream and handles the IOException
Summary: Provide a utility method that closes a stream and handles the IOException
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 1.5 M3   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-03 05:49 EDT by Rüdiger Herrmann CLA
Modified: 2011-10-18 06:00 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rüdiger Herrmann CLA 2011-06-03 05:49:50 EDT
There are several places across the RWT code base where a stream is closed, the IOException is caught and turned into a runtime exception of some sort:
* ThemeManager
* ImageDataFactory
* ImageFactory
* InternalImageFactory
These code passages should be united in one place. One candiate would be the class StreamWritingUtil if it were renamed to something more general like StreamUtil, or IOUtil.
Comment 1 Rüdiger Herrmann CLA 2011-10-18 06:00:27 EDT
Renamed StreamWritingUtil to StreamUtil and introduced a close() method. If an IOException occues while closing an (input-)stream, it is wrapped into a RuntimeException and re-thrown.
Changes are in CVS HEAD.