commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Silvester <>
Subject [io] New StreamResolver interface.
Date Sat, 16 Dec 2006 01:41:39 GMT

I've built and am using a StreamResolver interface which I find useful, 
and wondered if anyone here would be interested in adding it to the 
commons-io library.

The basic interface is pretty simple, and is intended to allow simple 
access to input/output streams, without having to worry about the 
mechanics of exactly where/what kind of stream they are.

    public interface StreamResolver {
        public boolean exists(String path);
        public InputStream openInputStream(String path);
        public OutputStream openOutputStream(String path);
        public String resolvePath(String path);

I've currently got the following implementations:

    FileStreamResolver - a basic resolver just using a file path.
    ZipStreamResolver - uses base resolver to access a zip file, and 
provides access to files within the archive.
    ServletStreamResolver - based on a ServletContext, using 
getResourceAsStream() internally.

If anyone wants to checkout my current implementation, you can currently 
find it at

If anyone is interested in this, I'll be happy to format it as per the 
guidelines, and contribute it to the project.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message