1 18 19 package org.apache.tools.ant.util; 20 21 import java.io.ByteArrayOutputStream ; 22 23 import org.apache.tools.ant.Project; 24 25 30 public class PropertyOutputStream extends ByteArrayOutputStream { 31 private Project project; 32 private String property; 33 private boolean trim; 34 35 41 public PropertyOutputStream(Project p, String s) { 42 this(p, s, true); 43 } 44 45 52 public PropertyOutputStream(Project p, String s, boolean b) { 53 project = p; 54 property = s; 55 trim = b; 56 } 57 58 61 public void close() { 62 if (project != null && property != null) { 63 String s = new String (toByteArray()); 64 project.setNewProperty(property, trim ? s.trim() : s); 65 } 66 } 67 68 } 69 70 | Popular Tags |