ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Stevens <>
Subject Re: Folder-Comments
Date Thu, 24 Sep 2009 23:04:52 GMT
2009/9/22 Arne v.Irmer <>:
> Hi,
> with the command line program "zip" I can create a zip-File with annotated folders inside.
I try to generate such a zip-File with the classes coming with ant.jar.
> Here is my small example program:
> package;
> import;
> import;
> import;
> import;
> public class ZipTest {
>        public static void main (String argv[]) {
>                try {
>                        FileOutputStream dest = new FileOutputStream("/tmp/");
>                        ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(dest));
>                        ZipEntry folderEntry = new ZipEntry("TestFolder");

In the souce code for ZipEntry I see
     public boolean isDirectory() {
         return getName().endsWith("/");
so I expect that should be new ZipEntry("TestFolder/")...
"TestFolder" is a perfectly valid name for a file - extensions aren't
mandatory, especially on non-windows systems.  The fact you don't call
out.write() for folderEntry explains why it then has a length of 0,
but asides from that it looks to me that you're creating two files,
one of which happens to be in a folder with the same name as the first
one (hence the errors you get when unzipping).

I'm curious what exactly this has to do with Ant, though?

--  open source java sudoku application

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

View raw message