[ https://issues.apache.org/jira/browse/IO-192?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jukka Zitting resolved IO-192. ------------------------------ Resolution: Fixed Fix Version/s: (was: 1.5) 2.0 As suggested and discussed, I added static check methods to the TaggedIOException class and made the tags Serializable in revision 803310. Each tagged stream uses a random UUID as an exception tag that is guaranteed (in all practical cases) to remain unique to the originating stream even if the exception is serialized and passed to another JVM. Resolving as fixed for Commons IO 2.0. I updated the @since tags in the source to refer to IO 2.0 as it seems like we're not planning a 1.5 release anymore. > Tagged input and output streams > ------------------------------- > > Key: IO-192 > URL: https://issues.apache.org/jira/browse/IO-192 > Project: Commons IO > Issue Type: New Feature > Components: Streams/Writers > Reporter: Jukka Zitting > Assignee: Jukka Zitting > Priority: Minor > Fix For: 2.0 > > Attachments: IO-192-tagged-stream-changes.patch, IO-192.patch > > > I'd like to introduce two new proxy streams, TaggedInputStream and > TaggedOutputStream, that tag all exceptions thrown by the proxied streams. > The goal is to make it easier to detect the source of an IOException when > you're dealing with multiple different streams. For example: > {code} > InputStream input = ...; > OutputStream output = ...; > TaggedOutputStream proxy = new TaggedOutputStream(output); > try { > IOUtils.copy(input, proxy); > } catch (IOException e) { > if (proxy.isTagged(e)) { > // Could not write to the output stream > // Perhaps we can handle that error somehow (retry, cancel?) > e.initCause(); // gives the original exception from the proxied stream > } else { > // Could not read from the input stream, nothing we can do > throw e; > } > } > {code} > I'm working on a patch to implement such a feature. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.