1 18 package org.apache.tools.ant.taskdefs.optional.perforce; 19 import org.apache.tools.ant.BuildException; 20 import org.apache.tools.ant.Project; 21 import org.apache.oro.text.perl.Perl5Util; 22 23 import java.util.ArrayList ; 24 25 31 class FStatP4OutputHandler extends P4HandlerAdapter { 32 private P4Fstat parent; 33 private ArrayList existing = new ArrayList (); 34 private ArrayList nonExisting = new ArrayList (); 35 private static Perl5Util util = new Perl5Util(); 36 37 public FStatP4OutputHandler(P4Fstat parent) { 38 this.parent = parent; 39 } 40 41 public void process(String line) throws BuildException { 42 if (util.match("/^... clientFile (.+)$/", line)) { 43 String f = util.group(1); 44 existing.add(f); 45 } else if (util.match("/^(.+) - no such file/", line)) { 46 String f = util.group(1); 47 nonExisting.add(f); 48 } 49 parent.log(parent.util.substitute("s/^.*: //", line), 50 Project.MSG_VERBOSE); 51 } 52 53 public ArrayList getExisting() { 54 return existing; 55 } 56 57 public ArrayList getNonExisting() { 58 return nonExisting; 59 } 60 } 61 | Popular Tags |