1 package net.sf.jour.processor;
2
3 import java.io.IOException;
4 import java.io.InputStream;
5 import java.util.jar.JarEntry;
6 import java.util.jar.JarFile;
7
8 public class JarFileEntry implements Entry {
9
10 JarFile jarFile;
11
12 JarEntry jarEntry;
13
14 public JarFileEntry(JarFile jarFile, JarEntry jarEntry) {
15 this.jarFile = jarFile;
16 this.jarEntry = jarEntry;
17 }
18
19 public InputStream getInputStream() throws IOException {
20 return jarFile.getInputStream(this.jarEntry );
21 }
22
23 public Entry getOrigin() {
24 return this;
25 }
26
27 public String getName() {
28 return jarEntry.getName();
29 }
30
31 public long getSize() {
32 return jarEntry.getSize();
33 }
34
35 public long getTime() {
36 return jarEntry.getTime();
37 }
38
39 public boolean isClass() {
40 return jarEntry.getName().endsWith(".class");
41 }
42
43 public boolean isDirectory() {
44 return jarEntry.isDirectory();
45 }
46
47 }