blob: b633de1f58aa8785985895275337f241086926a0 [file] [log] [blame]
Stuart McCulloch5ec302d2008-12-04 07:58:07 +00001package aQute.lib.osgi;
2
3import java.io.*;
4
5public class JarResource implements Resource {
6 Jar jar;
7 String extra;
8
9 public JarResource(Jar jar ) {
10 this.jar = jar;
11 }
12
13 public String getExtra() {
14 return extra;
15 }
16
17 public long lastModified() {
18 return jar.lastModified();
19 }
20
21
22 public void write(OutputStream out) throws IOException {
23 jar.write(out);
24 }
25
26 public InputStream openInputStream() throws IOException {
27 ByteArrayOutputStream out = new ByteArrayOutputStream();
28 write(out);
29 out.close();
30 ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
31 return in;
32 }
33
34 public void setExtra(String extra) {
35 this.extra = extra;
36 }
37
38 public Jar getJar() {
39 return jar;
40 }
41
42}