KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > schlichtherle > io > archive > tar > TarEntry


1 /*
2  * TarEntry.java
3  *
4  * Created on 28. Februar 2006, 12:22
5  */

6 /*
7  * Copyright 2006 Schlichtherle IT Services
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 de.schlichtherle.io.archive.tar;
23
24 import de.schlichtherle.io.ArchiveEntryMetaData;
25 import de.schlichtherle.io.archive.spi.ArchiveEntry;
26
27 import java.io.File JavaDoc;
28
29 import javax.swing.Icon JavaDoc;
30
31 /**
32  * An entry in a TAR archive which implements the <code>ArchiveEntry</code>
33  * interface.
34  *
35  * @author Christian Schlichtherle
36  * @version @version@
37  * @since TrueZIP 6.0
38  */

39 public class TarEntry
40         extends org.apache.tools.tar.TarEntry
41         implements ArchiveEntry {
42     
43     public TarEntry(String JavaDoc entryName) {
44         super(entryName);
45     }
46     
47     public TarEntry(String JavaDoc entryName, TarEntry blueprint) {
48         super(entryName);
49         setMode(blueprint.getMode());
50         setModTime(blueprint.getModTime());
51         setSize(blueprint.getSize());
52         setUserId(blueprint.getUserId());
53         setUserName(blueprint.getUserName());
54         setGroupId(blueprint.getGroupId());
55         setGroupName(blueprint.getGroupName());
56     }
57
58     public TarEntry(File JavaDoc file) {
59         super(file);
60     }
61
62     public Icon JavaDoc getOpenIcon() {
63         return null;
64     }
65
66     public Icon JavaDoc getClosedIcon() {
67         return null;
68     }
69
70     public long getTime() {
71         return getModTime().getTime();
72     }
73
74     public void setTime(long time) {
75         setModTime(time);
76     }
77
78     private ArchiveEntryMetaData metaData;
79
80     public ArchiveEntryMetaData getMetaData() {
81         return metaData;
82     }
83
84     public void setMetaData(ArchiveEntryMetaData metaData) {
85         this.metaData = metaData;
86     }
87 }
88
Popular Tags