blob: 2fb5c54e18d4c1a9d33f07107bab5cc3d4fb7cc8 [file] [log] [blame]
Stuart McCulloch39cc9ac2012-07-16 13:43:38 +00001package aQute.bnd.osgi;
Stuart McCullochbb014372012-06-07 21:57:32 +00002
3import java.io.*;
4
5public class JarResource extends WriteResource {
6 Jar jar;
7 long size = -1;
8
9 public JarResource(Jar jar) {
10 this.jar = jar;
11 }
12
13 public long lastModified() {
14 return jar.lastModified();
15 }
16
17 public void write(OutputStream out) throws Exception {
18 try {
19 jar.write(out);
Stuart McCulloch2286f232012-06-15 13:27:53 +000020 }
21 catch (Exception e) {
Stuart McCullochbb014372012-06-07 21:57:32 +000022 e.printStackTrace();
23 throw e;
24 }
25 }
26
27 public Jar getJar() {
28 return jar;
29 }
30
31 public String toString() {
32 return ":" + jar.getName() + ":";
33 }
34
35}