1 23 24 package org.apache.tools.ant.taskdefs.optional.sun.appserv; 25 26 import org.apache.tools.ant.Task; 27 import org.apache.tools.ant.BuildException; 28 import org.apache.tools.ant.Project; 29 import org.apache.tools.ant.AntClassLoader; 30 import org.apache.tools.ant.types.Path; 31 32 import java.io.*; 33 import java.util.*; 34 35 41 42 public class SunONEInput extends Task { 43 44 private String msg; 45 private String value; 46 private String addproperty; 47 48 private BufferedReader keyboard; 49 50 LocalStringsManager lsm = new LocalStringsManager(); 51 52 public void init () 53 { 54 keyboard = new BufferedReader(new InputStreamReader(System.in)); 55 } 56 public void execute() throws BuildException { 58 59 try{ 60 61 System.out.println( msg); 62 value = keyboard.readLine(); 63 } 64 catch ( IOException ioe ) 65 { 66 System.out.println(lsm.getString("IOExceptionMsg", new Object [] {msg})); 67 } 68 if (addproperty != null) { 69 project.setProperty(addproperty, value); 70 } 71 } 72 73 75 public void setMessage(String msg) { 76 this.msg = msg; 77 } 78 79 80 public void setAddproperty (String addproperty) { 81 this.addproperty = addproperty; 82 } 83 84 85 } | Popular Tags |