Stuart McCulloch | b32291a | 2012-07-16 14:10:57 +0000 | [diff] [blame^] | 1 | package aQute.bnd.component; |
| 2 | |
| 3 | import java.io.*; |
| 4 | |
| 5 | import aQute.bnd.osgi.*; |
| 6 | import aQute.lib.tag.*; |
| 7 | |
| 8 | class TagResource extends WriteResource { |
| 9 | final Tag tag; |
| 10 | |
| 11 | public TagResource(Tag tag) { |
| 12 | this.tag = tag; |
| 13 | } |
| 14 | |
| 15 | public void write(OutputStream out) throws UnsupportedEncodingException { |
| 16 | OutputStreamWriter ow = new OutputStreamWriter(out, "UTF-8"); |
| 17 | PrintWriter pw = new PrintWriter(ow); |
| 18 | pw.println("<?xml version='1.1'?>"); |
| 19 | try { |
| 20 | tag.print(0, pw); |
| 21 | } |
| 22 | finally { |
| 23 | pw.flush(); |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | public long lastModified() { |
| 28 | return 0; |
| 29 | } |
| 30 | |
| 31 | } |