KickJava   Java API By Example, From Geeks To Geeks.

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


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 package org.netbeans.modules.subversion.client.parser;
20
21 import java.io.File JavaDoc;
22 import java.net.MalformedURLException JavaDoc;
23 import java.util.Date JavaDoc;
24 import org.tigris.subversion.svnclientadapter.ISVNInfo;
25 import org.tigris.subversion.svnclientadapter.SVNNodeKind;
26 import org.tigris.subversion.svnclientadapter.SVNRevision;
27 import org.tigris.subversion.svnclientadapter.SVNScheduleKind;
28 import org.tigris.subversion.svnclientadapter.SVNUrl;
29
30 /**
31  *
32  * @author Ed Hillmann
33  */

34 public class ParserSvnInfo implements ISVNInfo{
35     
36     private final File JavaDoc file;
37     private final SVNUrl url;
38     private final SVNUrl reposUrl;
39     private final String JavaDoc reposUuid;
40     private final SVNScheduleKind schedule;
41     private final SVNRevision.Number revision;
42     private final boolean isCopied;
43     private final SVNUrl urlCopiedFrom;
44     private final SVNRevision.Number revisionCopiedFrom;
45     private final Date JavaDoc lastChangedDate;
46     private final SVNRevision.Number lastChangedRevision;
47     private final String JavaDoc lastCommitAuthor;
48     private final Date JavaDoc lastDatePropsUpdate;
49     private final Date JavaDoc lastDateTextUpdate;
50     private final Date JavaDoc lockCreationDate;
51     private final String JavaDoc lockOwner;
52     private final String JavaDoc lockComment;
53     private final SVNNodeKind nodeKind;
54     private final File JavaDoc propertiesFile;
55     private final File JavaDoc basePropertiesFile;
56     
57     /** Creates a new instance of LocalSvnInfoImpl */
58     public ParserSvnInfo(File JavaDoc file, String JavaDoc url, String JavaDoc reposUrl, String JavaDoc reposUuid,
59         String JavaDoc schedule, long revision, boolean isCopied, String JavaDoc urlCopiedFrom,
60         long revisionCopiedFrom, Date JavaDoc lastChangedDate, long lastChangedRevision,
61         String JavaDoc lastCommitAuthor, Date JavaDoc lastDatePropsUpdate, Date JavaDoc lastDateTextUpdate,
62         Date JavaDoc lockCreationDate, String JavaDoc lockOwner, String JavaDoc lockComment, String JavaDoc nodeKind,
63         File JavaDoc propertiesFile, File JavaDoc basePropertiesFile) {
64         this.file = file;
65         try {
66             this.url = url != null ? new SVNUrl(url) : null;
67         } catch (MalformedURLException JavaDoc ex) {
68             throw new IllegalArgumentException JavaDoc(ex);
69         }
70         try {
71             this.reposUrl = reposUrl != null ? new SVNUrl(reposUrl) : null;
72         } catch (MalformedURLException JavaDoc ex) {
73             throw new IllegalArgumentException JavaDoc(ex);
74         }
75         this.reposUuid = reposUuid;
76         
77         this.schedule = SVNScheduleKind.fromString(schedule);
78         this.revision = new SVNRevision.Number(revision);
79         
80         this.isCopied = isCopied;
81         try {
82             this.urlCopiedFrom = isCopied && urlCopiedFrom != null ? new SVNUrl(urlCopiedFrom) : null;
83         } catch (MalformedURLException JavaDoc ex) {
84             throw new IllegalArgumentException JavaDoc(ex);
85         }
86         this.revisionCopiedFrom = isCopied ? new SVNRevision.Number(revisionCopiedFrom) : null;
87         
88         this.lastChangedDate = lastChangedDate;
89         this.lastChangedRevision = new SVNRevision.Number(lastChangedRevision);
90         this.lastCommitAuthor = lastCommitAuthor;
91         
92         this.lastDatePropsUpdate = lastDatePropsUpdate;
93         this.lastDateTextUpdate = lastDateTextUpdate;
94         
95         this.lockCreationDate = lockCreationDate;
96         this.lockOwner = lockOwner;
97         this.lockComment = lockComment;
98         
99         this.nodeKind = SVNNodeKind.fromString(nodeKind);
100         this.propertiesFile = propertiesFile;
101         this.basePropertiesFile = basePropertiesFile;
102     }
103
104     public boolean isCopied() {
105         return isCopied;
106     }
107
108     public String JavaDoc getUuid() {
109         return reposUuid;
110     }
111
112     public SVNUrl getUrl() {
113         return url;
114     }
115
116     public SVNScheduleKind getSchedule() {
117         return schedule;
118     }
119
120     public SVNRevision.Number getRevision() {
121         return revision;
122     }
123
124     public SVNRevision.Number getCopyRev() {
125         return revisionCopiedFrom;
126     }
127
128     public SVNUrl getCopyUrl() {
129         return urlCopiedFrom;
130     }
131
132     public File JavaDoc getFile() {
133         return file;
134     }
135
136     public Date JavaDoc getLastChangedDate() {
137         return lastChangedDate;
138     }
139
140     public SVNRevision.Number getLastChangedRevision() {
141         return lastChangedRevision;
142     }
143
144     public String JavaDoc getLastCommitAuthor() {
145         return lastCommitAuthor;
146     }
147
148     public Date JavaDoc getLastDatePropsUpdate() {
149         return lastDatePropsUpdate;
150     }
151
152     public Date JavaDoc getLastDateTextUpdate() {
153         return lastDateTextUpdate;
154     }
155
156     public String JavaDoc getLockComment() {
157         return lockComment;
158     }
159
160     public Date JavaDoc getLockCreationDate() {
161         return lockCreationDate;
162     }
163
164     public String JavaDoc getLockOwner() {
165         return lockOwner;
166     }
167
168     public SVNNodeKind getNodeKind() {
169         return nodeKind;
170     }
171
172     public SVNUrl getRepository() {
173         return reposUrl;
174     }
175
176     public String JavaDoc getUrlString() {
177         return url.toString();
178     }
179
180     public File JavaDoc getPropertyFile() {
181         return propertiesFile;
182     }
183     
184     public File JavaDoc getBasePropertyFile() {
185         return basePropertiesFile;
186     }
187 }
188
Popular Tags