Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew M Finkbeiner2012-08-06 19:16:04 -0400
committerRoberto E. Escobar2012-08-06 19:16:04 -0400
commit423175b0fa97ebe9ef811a58bcdf31974f41deea (patch)
treeef72d3f11c35f0eaee315e09447a50fef74232a7 /plugins/org.eclipse.osee.ote.version.svn/src/org/eclipse
parente7778297e5c5b2db9a6a7f679996f0b1a3b21b14 (diff)
downloadorg.eclipse.osee-423175b0fa97ebe9ef811a58bcdf31974f41deea.tar.gz
org.eclipse.osee-423175b0fa97ebe9ef811a58bcdf31974f41deea.tar.xz
org.eclipse.osee-423175b0fa97ebe9ef811a58bcdf31974f41deea.zip
feature[ats_342ZC]: Add ote version projects
Diffstat (limited to 'plugins/org.eclipse.osee.ote.version.svn/src/org/eclipse')
-rw-r--r--plugins/org.eclipse.osee.ote.version.svn/src/org/eclipse/osee/ote/version/svn/SvnFileVersion.java56
-rw-r--r--plugins/org.eclipse.osee.ote.version.svn/src/org/eclipse/osee/ote/version/svn/SvnVersionProvider.java29
2 files changed, 85 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.ote.version.svn/src/org/eclipse/osee/ote/version/svn/SvnFileVersion.java b/plugins/org.eclipse.osee.ote.version.svn/src/org/eclipse/osee/ote/version/svn/SvnFileVersion.java
new file mode 100644
index 0000000000..bf483d202c
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.version.svn/src/org/eclipse/osee/ote/version/svn/SvnFileVersion.java
@@ -0,0 +1,56 @@
+package org.eclipse.osee.ote.version.svn;
+
+import java.text.DateFormat;
+import java.util.Date;
+import java.util.Locale;
+
+import org.eclipse.osee.ote.version.FileVersion;
+import org.eclipse.team.svn.core.connector.SVNEntryInfo;
+
+
+public class SvnFileVersion implements FileVersion {
+
+ private SVNEntryInfo entry;
+ private DateFormat dateFormat;
+
+ public SvnFileVersion(SVNEntryInfo svnEntryInfo) {
+ this.entry = svnEntryInfo;
+ dateFormat = DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.DEFAULT, Locale.getDefault());
+ }
+
+ @Override
+ public String getVersion() {
+ return Long.toString(entry.revision);
+ }
+
+ @Override
+ public String getURL() {
+ return entry.url;
+ }
+
+ @Override
+ public String getVersionControlSystem() {
+ return "svn";
+ }
+
+ @Override
+ public String getModifiedFlag() {
+ /*
+ * IFile iFile = AIFile.constructIFile(file.getAbsolutePath());
+ ILocalResource local = SVNRemoteStorage.instance().asLocalResource(iFile);
+ entry.setModifiedFlag(SVNUtility.getStatusText(local.getStatus()));
+ */
+ return "N/A";
+ }
+
+ @Override
+ public String getLastModificationDate() {
+ return dateFormat.format(new Date(entry.lastChangedDate));
+ }
+
+ @Override
+ public String getLastAuthor() {
+ return entry.lastChangedAuthor;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ote.version.svn/src/org/eclipse/osee/ote/version/svn/SvnVersionProvider.java b/plugins/org.eclipse.osee.ote.version.svn/src/org/eclipse/osee/ote/version/svn/SvnVersionProvider.java
new file mode 100644
index 0000000000..741429df0d
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.version.svn/src/org/eclipse/osee/ote/version/svn/SvnVersionProvider.java
@@ -0,0 +1,29 @@
+package org.eclipse.osee.ote.version.svn;
+
+import java.io.File;
+
+import org.eclipse.osee.ote.version.FileVersion;
+import org.eclipse.osee.ote.version.FileVersionInformationProvider;
+import org.eclipse.team.svn.core.connector.SVNEntryInfo;
+import org.eclipse.team.svn.core.utility.SVNUtility;
+
+public class SvnVersionProvider implements FileVersionInformationProvider {
+
+
+ @Override
+ public FileVersion getFileVersion(File file) {
+ if (isSvn(file)) {
+ SVNEntryInfo entry = SVNUtility.getSVNInfo(file);
+ if(entry != null){
+ return new SvnFileVersion(entry);
+ }
+ }
+ return null;
+ }
+
+ protected boolean isSvn(File file) {
+ File svn = new File(file.getParentFile(), SVNUtility.getSVNFolderName());
+ return svn.exists();
+ }
+
+}

Back to the top