KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > subversion > client > parser > ParserSvnStatus


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.subversion.client.parser;
21
22 import java.io.File JavaDoc;
23 import java.lang.UnsupportedOperationException JavaDoc;
24 import java.net.MalformedURLException JavaDoc;
25 import java.util.Date JavaDoc;
26 import org.tigris.subversion.svnclientadapter.ISVNStatus;
27 import org.tigris.subversion.svnclientadapter.SVNNodeKind;
28 import org.tigris.subversion.svnclientadapter.SVNRevision;
29 import org.tigris.subversion.svnclientadapter.SVNStatusKind;
30 import org.tigris.subversion.svnclientadapter.SVNUrl;
31
32 /**
33  *
34  * @author Ed Hillmann
35  */

36 public class ParserSvnStatus implements ISVNStatus {
37
38     private File JavaDoc file = null;
39     private SVNUrl url = null;
40     private SVNRevision.Number revision = null;
41     private SVNNodeKind kind = null;
42     private SVNStatusKind textStatus = null;
43     private SVNStatusKind propStatus = null;
44     private String JavaDoc lastCommitAuthor = null;
45     private SVNRevision.Number lastChangedRevision = null;
46     private Date JavaDoc lastChangedDate = null;
47     private boolean isCopied = false;
48     private SVNUrl urlCopiedFrom = null;
49     private File JavaDoc conflictNew = null;
50     private File JavaDoc conflictOld = null;
51     private File JavaDoc conflictWorking = null;
52     private Date JavaDoc lockCreationDate = null;
53     private String JavaDoc lockComment = null;
54     private String JavaDoc lockOwner = null;
55
56     /** Creates a new instance of LocalSvnStatusImpl */
57     public ParserSvnStatus(File JavaDoc file, String JavaDoc url, long revision, String JavaDoc kind,
58             String JavaDoc textStatus, String JavaDoc propStatus,
59             String JavaDoc lastCommitAuthor, long lastChangedRevision, Date JavaDoc lastChangedDate,
60             boolean isCopied, String JavaDoc urlCopiedFrom,
61             File JavaDoc conflictNew, File JavaDoc conflictOld, File JavaDoc conflictWorking,
62             Date JavaDoc lockCreationDate, String JavaDoc lockComment, String JavaDoc lockOwner) {
63
64         this.file = file;
65
66         if (url != null) {
67             try {
68                 this.url = new SVNUrl(url);
69             } catch (MalformedURLException JavaDoc ex) {
70                 throw new IllegalArgumentException JavaDoc(ex);
71             }
72         }
73
74         this.revision = new SVNRevision.Number(revision);
75         this.kind = SVNNodeKind.fromString(kind);
76
77         this.textStatus = SVNStatusKind.fromString(textStatus);
78         this.propStatus = SVNStatusKind.fromString(propStatus);
79         this.lastCommitAuthor = lastCommitAuthor;
80
81         this.lastChangedRevision = new SVNRevision.Number(lastChangedRevision);
82         this.lastChangedDate = lastChangedDate;
83
84         this.isCopied = isCopied;
85         if (urlCopiedFrom != null) {
86             try {
87                 this.urlCopiedFrom = new SVNUrl(urlCopiedFrom);
88             } catch (MalformedURLException JavaDoc ex) {
89                 throw new IllegalArgumentException JavaDoc(ex);
90             }
91         }
92
93         this.conflictNew = conflictNew;
94         this.conflictOld = conflictOld;
95         this.conflictWorking = conflictWorking;
96         this.lockCreationDate = lockCreationDate;
97         this.lockComment = lockComment;
98         this.lockOwner = lockOwner;
99     }
100
101     public boolean isCopied() {
102         return isCopied;
103     }
104
105     public SVNUrl getUrlCopiedFrom() {
106         return urlCopiedFrom;
107     }
108
109     public SVNUrl getUrl() {
110         return url;
111     }
112
113     public SVNStatusKind getTextStatus() {
114         return textStatus;
115     }
116
117     public SVNRevision.Number getRevision() {
118         return revision;
119     }
120
121     public SVNStatusKind getRepositoryTextStatus() {
122         throw new UnsupportedOperationException JavaDoc("getRepositoryTextStatus() is not implemented"); // NOI18N
123
}
124
125     public SVNStatusKind getRepositoryPropStatus() {
126         throw new UnsupportedOperationException JavaDoc("getRepositoryPropStatus() is not implemented"); // NOI18N
127
}
128
129     public File JavaDoc getConflictNew() {
130         return conflictNew;
131     }
132
133     public File JavaDoc getConflictOld() {
134         return conflictOld;
135     }
136
137     public File JavaDoc getConflictWorking() {
138         return conflictWorking;
139     }
140
141     public File JavaDoc getFile() {
142         return file;
143     }
144
145     public Date JavaDoc getLastChangedDate() {
146         return lastChangedDate;
147     }
148
149     public SVNRevision.Number getLastChangedRevision() {
150         return lastChangedRevision;
151     }
152
153     public String JavaDoc getLastCommitAuthor() {
154         return lastCommitAuthor;
155     }
156
157     public String JavaDoc getLockComment() {
158         return lockComment;
159     }
160
161     public Date JavaDoc getLockCreationDate() {
162         return lockCreationDate;
163     }
164
165     public String JavaDoc getLockOwner() {
166         return lockOwner;
167     }
168
169     public SVNNodeKind getNodeKind() {
170         return kind;
171     }
172
173     public String JavaDoc getPath() {
174         return file.getPath();
175     }
176
177     public SVNStatusKind getPropStatus() {
178         return propStatus;
179     }
180
181     public String JavaDoc getUrlString() {
182         return url.toString();
183     }
184
185     public boolean isWcLocked() {
186         // TODO implement me
187
throw new UnsupportedOperationException JavaDoc("not implemented yet"); // NOI18N
188
}
189
190     public boolean isSwitched() {
191         // TODO implement me
192
throw new UnsupportedOperationException JavaDoc("not implemented yet"); // NOI18N
193
}
194
195 }
196
197
Popular Tags