1 package org.apache.maven.scm.provider.accurev.cli;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.maven.scm.log.ScmLogger;
23 import org.codehaus.plexus.util.cli.StreamConsumer;
24
25
26
27
28 public class CommandOutputConsumer
29 implements StreamConsumer
30 {
31
32 private final ScmLogger logger;
33
34 private StreamConsumer decorated;
35
36 public CommandOutputConsumer( ScmLogger logger, StreamConsumer decorated )
37 {
38 this.decorated = decorated;
39 this.logger = logger;
40 }
41
42 public void consumeLine( String line )
43 {
44 if ( logger.isDebugEnabled() )
45 {
46 logger.debug( line );
47 }
48
49 if ( decorated != null )
50 {
51 decorated.consumeLine( line );
52 }
53 }
54
55 public void waitComplete()
56 {
57 if ( decorated instanceof XppStreamConsumer )
58 {
59 ( (XppStreamConsumer) decorated ).waitComplete();
60 }
61
62 }
63
64 }