1 19 package org.netbeans.modules.subversion.client.parser; 20 21 import java.io.File ; 22 import java.net.MalformedURLException ; 23 import java.util.Date ; 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 34 public class LocalSvnInfoImpl implements ISVNInfo{ 35 36 private final File file; 37 private final SVNUrl url; 38 private final SVNUrl reposUrl; 39 private final String 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 lastChangedDate; 46 private final SVNRevision.Number lastChangedRevision; 47 private final String lastCommitAuthor; 48 private final Date lastDatePropsUpdate; 49 private final Date lastDateTextUpdate; 50 private final Date lockCreationDate; 51 private final String lockOwner; 52 private final String lockComment; 53 private final SVNNodeKind nodeKind; 54 private final File propertiesFile; 55 private final File basePropertiesFile; 56 57 58 public LocalSvnInfoImpl(File file, String url, String reposUrl, String reposUuid, 59 String schedule, long revision, boolean isCopied, String urlCopiedFrom, 60 long revisionCopiedFrom, Date lastChangedDate, long lastChangedRevision, 61 String lastCommitAuthor, Date lastDatePropsUpdate, Date lastDateTextUpdate, 62 Date lockCreationDate, String lockOwner, String lockComment, String nodeKind, 63 File propertiesFile, File basePropertiesFile) { 64 this.file = file; 65 try { 66 this.url = url != null ? new SVNUrl(url) : null; 67 } catch (MalformedURLException ex) { 68 throw new IllegalArgumentException (ex); 69 } 70 try { 71 this.reposUrl = reposUrl != null ? new SVNUrl(reposUrl) : null; 72 } catch (MalformedURLException ex) { 73 throw new IllegalArgumentException (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 ex) { 84 throw new IllegalArgumentException (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 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 getFile() { 133 return file; 134 } 135 136 public Date getLastChangedDate() { 137 return lastChangedDate; 138 } 139 140 public SVNRevision.Number getLastChangedRevision() { 141 return lastChangedRevision; 142 } 143 144 public String getLastCommitAuthor() { 145 return lastCommitAuthor; 146 } 147 148 public Date getLastDatePropsUpdate() { 149 return lastDatePropsUpdate; 150 } 151 152 public Date getLastDateTextUpdate() { 153 return lastDateTextUpdate; 154 } 155 156 public String getLockComment() { 157 return lockComment; 158 } 159 160 public Date getLockCreationDate() { 161 return lockCreationDate; 162 } 163 164 public String 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 getUrlString() { 177 return url.toString(); 178 } 179 180 public File getPropertyFile() { 181 return propertiesFile; 182 } 183 184 public File getBasePropertyFile() { 185 return basePropertiesFile; 186 } 187 } 188 | Popular Tags |