commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: [COMPRESS] Add getArchiveType() method to [Archive|Compressor]InputStream classes?
Date Tue, 11 May 2010 19:12:50 GMT
On 11/05/2010, Torsten Curdt <tcurdt@vafer.org> wrote:
> In the code we call it "Archivername". That should be changed
>  accordingly to "type" then IMO. (getArchiveName() could be a little
>  ambiguous)
>
>  That said: Is there a particular reason you need this? Or is this just
>  because you think it might be useful?

I was thinking it would be useful for the proposed command-line
utility - you could pass it any archive file and find out what it is.

Also it would be useful for unit tests, to check that the correct type
has been detected.
[Yes, one check the class name, but that is a bit messy].

>
>  On Tue, May 11, 2010 at 17:55, sebb <sebbaz@gmail.com> wrote:
>  > Seems to me that it would be useful to be able to find out what
>  > ArchiveInputStream has been chosen by the ArchiveStreamFactory.
>  >
>  > I'm thinking of adding something like:
>  >
>  > public String getArchiveType() {
>  >   return ArchiveStreamFactory.TAR ; // or ZIP etc.
>  > }
>  >
>  > to each of the AIS subclasses.
>  >
>  > The AIS parent class could either have a dummy implementation, or the
>  > parent method could be abstract to force subclasses to provide the
>  > method.
>  >
>  > The same could be done for CompressorStreamFactory.
>  >
>  > Thoughts?
>  >
>
> > ---------------------------------------------------------------------
>  > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>  > For additional commands, e-mail: dev-help@commons.apache.org
>  >
>  >
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>  For additional commands, e-mail: dev-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message