Subversion Repositories XServices

Rev

Rev 94 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 94 Rev 113
Line 1... Line 1...
1
package net.brutex.xservices.util;
1
/*     */ package net.brutex.xservices.util;
2
 
2
/*     */ 
3
import java.io.PrintStream;
3
/*     */ import java.io.PrintStream;
4
 
-
 
5
import org.netbeans.lib.cvsclient.command.FileInfoContainer;
-
 
6
import org.netbeans.lib.cvsclient.command.log.LogInformation;
-
 
7
import org.netbeans.lib.cvsclient.event.BinaryMessageEvent;
4
/*     */ import org.netbeans.lib.cvsclient.event.BinaryMessageEvent;
8
import org.netbeans.lib.cvsclient.event.CVSAdapter;
-
 
9
import org.netbeans.lib.cvsclient.event.CVSListener;
5
/*     */ import org.netbeans.lib.cvsclient.event.CVSListener;
10
import org.netbeans.lib.cvsclient.event.FileAddedEvent;
6
/*     */ import org.netbeans.lib.cvsclient.event.FileAddedEvent;
11
import org.netbeans.lib.cvsclient.event.FileInfoEvent;
7
/*     */ import org.netbeans.lib.cvsclient.event.FileInfoEvent;
12
import org.netbeans.lib.cvsclient.event.FileRemovedEvent;
8
/*     */ import org.netbeans.lib.cvsclient.event.FileRemovedEvent;
13
import org.netbeans.lib.cvsclient.event.FileToRemoveEvent;
9
/*     */ import org.netbeans.lib.cvsclient.event.FileToRemoveEvent;
14
import org.netbeans.lib.cvsclient.event.FileUpdatedEvent;
10
/*     */ import org.netbeans.lib.cvsclient.event.FileUpdatedEvent;
15
import org.netbeans.lib.cvsclient.event.MessageEvent;
11
/*     */ import org.netbeans.lib.cvsclient.event.MessageEvent;
16
import org.netbeans.lib.cvsclient.event.ModuleExpansionEvent;
12
/*     */ import org.netbeans.lib.cvsclient.event.ModuleExpansionEvent;
17
import org.netbeans.lib.cvsclient.event.TerminationEvent;
13
/*     */ import org.netbeans.lib.cvsclient.event.TerminationEvent;
18
 
14
/*     */ 
19
public abstract class BasicCVSListener implements CVSListener
15
/*     */ public abstract class BasicCVSListener
20
{
-
 
21
    /**
-
 
22
     * Stores a tagged line
16
/*     */   implements CVSListener
23
     */
17
/*     */ {
24
    private final StringBuffer taggedLine = new StringBuffer();
18
/*  24 */   private final StringBuffer taggedLine = new StringBuffer();
25
 
-
 
26
    /**
19
/*     */ 
27
     * Called when the server wants to send a message to be displayed to
-
 
28
     * the user. The message is only for information purposes and clients
-
 
29
     * can choose to ignore these messages if they wish.
20
/*  26 */   private final boolean showEvents = true;
30
     * @param e the event
-
 
31
     */
21
/*     */ 
32
    public void messageSent(MessageEvent e)
22
/*     */   public void messageSent(MessageEvent e)
33
    {
23
/*     */   {
34
        String line = e.getMessage();
24
/*  36 */     String line = e.getMessage();
35
        PrintStream stream = e.isError() ? System.err
25
/*  37 */     PrintStream stream = e.isError() ? System.err : 
36
                                         : System.out;
26
/*  38 */       System.out;
37
 
27
/*     */ 
38
        if (e.isTagged())
28
/*  40 */     if (e.isTagged())
39
        {
29
/*     */     {
40
            String message = e.parseTaggedMessage(taggedLine, line);
30
/*  42 */       String str1 = MessageEvent.parseTaggedMessage(this.taggedLine, line);
41
	    // if we get back a non-null line, we have something
31
/*     */     }
42
	    // to output. Otherwise, there is more to come and we
32
/*     */   }
43
	    // should do nothing yet.
33
/*     */ 
44
            if (message != null)
34
/*     */   public void commandTerminated(TerminationEvent arg0)
45
            {
35
/*     */   {
46
                //stream.println("Message: " + message);
36
/*  59 */     System.out.println("commandTerminated");
47
            }
37
/*     */   }
48
        }
38
/*     */ 
49
        else
39
/*     */   public void fileAdded(FileAddedEvent arg0)
50
        {
40
/*     */   {
51
            //stream.println("Message: " + line);
41
/*  65 */     System.out.println("fileAdded");
52
        }
42
/*     */   }
53
    }
43
/*     */ 
54
 
-
 
55
	@Override
-
 
56
	public void commandTerminated(TerminationEvent arg0) {
44
/*     */   public void fileInfoGenerated(FileInfoEvent arg0)
57
		
-
 
58
	}
-
 
59
 
-
 
60
	@Override
45
/*     */   {
61
	public void fileAdded(FileAddedEvent arg0) {
46
/*  71 */     System.out.println("fileInfoGenerated");
62
		
-
 
63
		
-
 
64
	}
47
/*     */   }
65
 
-
 
66
	@Override
48
/*     */ 
67
	public void fileInfoGenerated(FileInfoEvent arg0) {
49
/*     */   public void fileRemoved(FileRemovedEvent arg0)
68
		FileInfoContainer info = arg0.getInfoContainer();
-
 
69
		LogInformation info2 = (LogInformation) info;
50
/*     */   {
70
		System.out.println(info2.getRepositoryFilename());
-
 
71
		System.out.println(info2.getDescription());
51
/*  76 */     System.out.println("fileRemoved");
72
		
-
 
73
	}
52
/*     */   }
74
 
-
 
75
	@Override
53
/*     */ 
76
	public void fileRemoved(FileRemovedEvent arg0) {
54
/*     */   public void fileToRemove(FileToRemoveEvent arg0)
77
		// TODO Auto-generated method stub
-
 
78
		
-
 
79
	}
-
 
80
 
-
 
81
	@Override
55
/*     */   {
82
	public void fileToRemove(FileToRemoveEvent arg0) {
56
/*  82 */     System.out.println("fileToRemove");
83
		// TODO Auto-generated method stub
57
/*     */   }
84
		
-
 
85
	}
-
 
86
 
-
 
87
	@Override
58
/*     */ 
88
	public void fileUpdated(FileUpdatedEvent arg0) {
59
/*     */   public void fileUpdated(FileUpdatedEvent arg0)
-
 
60
/*     */   {
89
		// TODO Auto-generated method stub
61
/*  88 */     System.out.println("fileUpdated");
90
		
-
 
91
	}
62
/*     */   }
92
 
-
 
93
	@Override
63
/*     */ 
94
	public void messageSent(BinaryMessageEvent arg0) {
64
/*     */   public void messageSent(BinaryMessageEvent arg0)
-
 
65
/*     */   {
95
		// TODO Auto-generated method stub
66
/*  94 */     System.out.println("messageSent_Binary");
96
		
-
 
97
	}
67
/*     */   }
98
 
-
 
99
	@Override
68
/*     */ 
100
	public void moduleExpanded(ModuleExpansionEvent arg0) {
69
/*     */   public void moduleExpanded(ModuleExpansionEvent arg0)
-
 
70
/*     */   {
101
		// TODO Auto-generated method stub
71
/* 100 */     System.out.println("ModuleExpansionEvent");
-
 
72
/*     */   }
-
 
73
/*     */ }
102
		
74
 
-
 
75
/* Location:           C:\Users\brosenberger\Documents\My Box Files\XBridgeNG-download\XServices-20130131 - Kopie\WEB-INF\classes\net.zip
-
 
76
 * Qualified Name:     net.brutex.xservices.util.BasicCVSListener
-
 
77
 * JD-Core Version:    0.6.2
103
	}
78
 */
104
}
-
 
105
79