View Javadoc
1   package com.github.davidmoten.rx2.util;
2   
3   import java.io.InputStream;
4   import java.util.zip.ZipEntry;
5   
6   public final class ZippedEntry {
7   
8       final String name; // entry name
9       final long time; // last modification time
10      // final FileTime mtime; // last modification time, from extra field data
11      // final FileTime atime; // last access time, from extra field data
12      // final FileTime ctime; // creation time, from extra field data
13      final long crc; // crc-32 of entry data
14      final long size; // uncompressed size of entry data
15      final long csize; // compressed size of entry data
16      final int method; // compression method
17      final byte[] extra; // optional extra field data for entry
18      final String comment; // optional comment string for entry
19      private final InputStream is;
20  
21      public ZippedEntry(ZipEntry e, InputStream is) {
22          this.name = e.getName();
23          this.time = e.getTime();
24          // this.mtime = e.getLastModifiedTime();
25          // this.atime = e.getLastAccessTime();
26          // this.ctime = e.getCreationTime();
27          this.crc = e.getCrc();
28          this.size = e.getSize();
29          this.csize = e.getCompressedSize();
30          this.method = e.getMethod();
31          this.extra = e.getExtra();
32          this.comment = e.getComment();
33          this.is = is;
34      }
35  
36      public InputStream getInputStream() {
37          return is;
38      }
39  
40      public String getName() {
41          return name;
42      }
43  
44      public long getTime() {
45          return time;
46      }
47  
48      // public FileTime getLastModifiedTime() {
49      // return mtime;
50      // }
51  
52      // public FileTime getLastAccessTime() {
53      // return atime;
54      // }
55  
56      // public FileTime getCreatedtime() {
57      // return ctime;
58      // }
59  
60      public long getCrc() {
61          return crc;
62      }
63  
64      public long getSize() {
65          return size;
66      }
67  
68      public long getCompressedSize() {
69          return csize;
70      }
71  
72      public int getMethod() {
73          return method;
74      }
75  
76      public byte[] getExtra() {
77          return extra;
78      }
79  
80      public String getComment() {
81          return comment;
82      }
83  
84  }