ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/AntTasks/source/net/douglasthrift/anttasks/UnixZip.java
(Generate patch)

Comparing AntTasks/source/net/douglasthrift/anttasks/UnixZip.java (file contents):
Revision 974 by douglas, 2007-12-19T16:22:45-08:00 vs.
Revision 1107 by douglas, 2008-11-04T12:53:49-08:00

# Line 1 | Line 1
1 < // Unix Zip Ant Task
2 < //
3 < // Douglas Thrift
4 < //
5 < // $Id$
6 <
7 < /*  Copyright 2007 Douglas Thrift
8 < *
9 < *  Licensed under the Apache License, Version 2.0 (the "License");
10 < *  you may not use this file except in compliance with the License.
11 < *  You may obtain a copy of the License at
12 < *
13 < *      http://www.apache.org/licenses/LICENSE-2.0
14 < *
15 < *  Unless required by applicable law or agreed to in writing, software
16 < *  distributed under the License is distributed on an "AS IS" BASIS,
17 < *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 < *  See the License for the specific language governing permissions and
19 < *  limitations under the License.
20 < */
21 <
22 < package net.douglasthrift.anttasks;
23 <
24 < import java.io.File;
25 <
26 < import org.apache.tools.ant.Task;
27 < import org.apache.tools.ant.util.FileUtils;
28 <
29 < import org.apache.tools.zip.AsiExtraField;
30 < import org.apache.tools.zip.UnixStat;
31 < import org.apache.tools.zip.ZipEntry;
32 < import org.apache.tools.zip.ZipExtraField;
33 < import org.apache.tools.zip.ZipOutputStream;
34 <
35 < public class UnixZip extends Task
36 < {
37 <        public void execute()
38 <        {
39 <        }
40 < }
1 > // Unix Zip Ant Task
2 > //
3 > // Douglas Thrift
4 > //
5 > // $Id$
6 >
7 > /*  Copyright 2007 Douglas Thrift
8 > *
9 > *  Licensed under the Apache License, Version 2.0 (the "License");
10 > *  you may not use this file except in compliance with the License.
11 > *  You may obtain a copy of the License at
12 > *
13 > *      http://www.apache.org/licenses/LICENSE-2.0
14 > *
15 > *  Unless required by applicable law or agreed to in writing, software
16 > *  distributed under the License is distributed on an "AS IS" BASIS,
17 > *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 > *  See the License for the specific language governing permissions and
19 > *  limitations under the License.
20 > */
21 >
22 > package net.douglasthrift.anttasks;
23 >
24 > import java.io.ByteArrayInputStream;
25 > import java.io.IOException;
26 > import java.util.ArrayList;
27 >
28 > import org.apache.tools.ant.Task;
29 > import org.apache.tools.ant.taskdefs.Zip;
30 > import org.apache.tools.zip.ZipOutputStream;
31 >
32 > public class UnixZip extends Zip
33 > {
34 >        public static class Symlink extends Task
35 >        {
36 >                private String link;
37 >                private String resource;
38 >
39 >                public void setLink(String link)
40 >                {
41 >                        this.link = link;
42 >                }
43 >
44 >                public void setResource(String resource)
45 >                {
46 >                        this.resource = resource;
47 >                }
48 >        }
49 >
50 >        private ArrayList<Symlink> symlinks = new ArrayList<Symlink>();
51 >
52 >        public Symlink createSymlink()
53 >        {
54 >                Symlink symlink = new Symlink();
55 >
56 >                this.symlinks.add(symlink);
57 >
58 >                return symlink;
59 >        }
60 >
61 >        protected void finalizeZipOutputStream(ZipOutputStream output) throws IOException
62 >        {
63 >                for (Symlink symlink: symlinks)
64 >                        this.zipFile(new ByteArrayInputStream(symlink.resource.getBytes()), output, symlink.link, System.currentTimeMillis(), null, 0120755);
65 >        }
66 > }

Comparing AntTasks/source/net/douglasthrift/anttasks/UnixZip.java (property svn:eol-style):
Revision 974 by douglas, 2007-12-19T16:22:45-08:00 vs.
Revision 1107 by douglas, 2008-11-04T12:53:49-08:00

# Line 0 | Line 1
1 + native

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines