commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eirik Maus (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (COMPRESS-118) Simple high-level api to do with one line what you can do with one command in a command shell
Date Mon, 20 Feb 2012 20:21:34 GMT

    [ https://issues.apache.org/jira/browse/COMPRESS-118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13212048#comment-13212048
] 

Eirik Maus commented on COMPRESS-118:
-------------------------------------

I tried TrueZip, but I couldn't prevent it from unzipping recursively (despite copying example
code that was supposed to not recurse into archives inside the archive). Also, the truezip
API classes all had the same names as the java.io.* classes that my code was already full
of, making it totally unreadable. Besides, I felt that adding this huge (and, I must admit,
very powerful) library was overkill for only wanting to unzip a war-file in less than 100
lines. 
                
> Simple high-level api to do with one line what you can do with one command in a command
shell
> ---------------------------------------------------------------------------------------------
>
>                 Key: COMPRESS-118
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-118
>             Project: Commons Compress
>          Issue Type: New Feature
>          Components: Archivers
>            Reporter: Eirik Maus
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> There should be a high-level api for basic operations with archives in Java. This could
be a place for it. There are a few apis for working with compression archives in java, but
all of them are fairly low-level. The most basic operations therefore requires just as much
code as more specific ones.  It is not possible to unzip an archive in less than 50 lines
of code, can you believe it!  
> Performing basic operations on archives should be as easy in java as on the command line.
I suggest adding something like:
>   HighLevelApi.extractAll(zipfile,destinationDirectory)
> or, even
>   new ZipFile(file).extractAllTo(directory)
> and
>   ZipFile archive = HighLevelApi.createFrom(directory, "*");
> or, even
>   ZipFile archive = ZipFile.from(directory);
> In general: one line in bash should be one line in java (plus try-catch...) for these
kinds of operations. 
> See "zip --help" and "unzip --help" for further candidate methods in the high-level API.

> One could also consider a coordinated effort with the VFS-project, in order to add such
methods to all such hierarchies/storages. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message