Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew M. Finkbeiner2017-01-10 20:43:45 -0500
committerDavid W. Miller2017-01-10 20:43:45 -0500
commit7be45528f865e01ae6d146e92c7839341c749478 (patch)
treea4d6ff2213a3d4fb074ee14adcb156efcb0cdad1 /plugins/org.eclipse.osee.ote.version.svn/src/org/eclipse
parentc2bad9dd87b9c057285bca31dfe540a2aac11c3c (diff)
downloadorg.eclipse.osee-7be45528f865e01ae6d146e92c7839341c749478.tar.gz
org.eclipse.osee-7be45528f865e01ae6d146e92c7839341c749478.tar.xz
org.eclipse.osee-7be45528f865e01ae6d146e92c7839341c749478.zip
feature[ats_ATS331089]: Move the OTE bundles out of OSEE repos
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/ScriptToProject.java77
-rw-r--r--plugins/org.eclipse.osee.ote.version.svn/src/org/eclipse/osee/ote/version/svn/SvnFileVersion.java65
-rw-r--r--plugins/org.eclipse.osee.ote.version.svn/src/org/eclipse/osee/ote/version/svn/SvnVersionProvider.java66
3 files changed, 0 insertions, 208 deletions
diff --git a/plugins/org.eclipse.osee.ote.version.svn/src/org/eclipse/osee/ote/version/svn/ScriptToProject.java b/plugins/org.eclipse.osee.ote.version.svn/src/org/eclipse/osee/ote/version/svn/ScriptToProject.java
deleted file mode 100644
index 780d197d02..0000000000
--- a/plugins/org.eclipse.osee.ote.version.svn/src/org/eclipse/osee/ote/version/svn/ScriptToProject.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Created on Feb 27, 2013
- *
- * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
- */
-package org.eclipse.osee.ote.version.svn;
-
-import java.io.File;
-import java.net.URI;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.team.svn.core.utility.SVNUtility;
-
-public class ScriptToProject {
-
- private final Map<String, Set<String>> projectsScriptsMap = new HashMap<>();
- private final Map<String, File> scriptNameToScriptFileMap = new HashMap<>();
- private final IProject[] workspaceProjects;
-
- public ScriptToProject(IProject[] workspaceProjects) {
- this.workspaceProjects = workspaceProjects;
- }
-
- public void add(File scriptFile) {
- String scriptName = scriptFile.getName();
- IProject scriptProject = null;
-
- for (IProject project : workspaceProjects) {
- String projectName = project.getName();
- if (scriptFile.toString().contains(projectName)) {
- scriptProject = project;
- }
- }
-
- URI scriptProjectLocationUri = null;
- if (scriptProject != null) {
- scriptProject.getLocationURI();
- }
- File scriptProjectFile = new File(scriptProjectLocationUri);
-
- if (isSvn(scriptProjectFile)) {
- String scriptProjectLocation = scriptProjectFile.getAbsolutePath();
- addScriptListValue(scriptProjectLocation, scriptName);
- scriptNameToScriptFileMap.put(scriptName, scriptFile);
- }
- }
-
- public Set<String> getProjectsSet() {
- return projectsScriptsMap.keySet();
- }
-
- public void addScriptListValue(String key, String value) {
- Set<String> values = projectsScriptsMap.get(key);
- if (values == null) {
- values = new HashSet<>();
- projectsScriptsMap.put(key, values);
- }
- values.add(value);
- }
-
- public File getScriptFileMatch(String project, String itemToMatch) {
- Set<String> scriptsForProject = projectsScriptsMap.get(project);
- if (scriptsForProject.contains(itemToMatch)) {
- return scriptNameToScriptFileMap.get(itemToMatch);
- } else {
- return null;
- }
- }
-
- protected boolean isSvn(File file) {
- File svn = new File(file, SVNUtility.getSVNFolderName());
- return svn.exists();
- }
-}
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
deleted file mode 100644
index 81f3e75e7e..0000000000
--- a/plugins/org.eclipse.osee.ote.version.svn/src/org/eclipse/osee/ote/version/svn/SvnFileVersion.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-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 getLastChangedRevision() {
- return Long.toString(entry.lastChangedRevision);
- }
-
- @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
deleted file mode 100644
index 6cd50ee605..0000000000
--- a/plugins/org.eclipse.osee.ote.version.svn/src/org/eclipse/osee/ote/version/svn/SvnVersionProvider.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.ote.version.svn;
-
-import java.io.File;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Level;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.ote.version.FileVersion;
-import org.eclipse.osee.ote.version.FileVersionInformationProvider;
-import org.eclipse.team.svn.core.connector.ISVNConnector;
-import org.eclipse.team.svn.core.connector.SVNDepth;
-import org.eclipse.team.svn.core.connector.SVNEntryInfo;
-import org.eclipse.team.svn.core.connector.SVNEntryRevisionReference;
-import org.eclipse.team.svn.core.extension.CoreExtensionsManager;
-import org.eclipse.team.svn.core.operation.SVNNullProgressMonitor;
-import org.eclipse.team.svn.core.utility.SVNUtility;
-
-public class SvnVersionProvider implements FileVersionInformationProvider {
-
- protected boolean isSvn(File file) {
- File svn = new File(file, SVNUtility.getSVNFolderName());
- return svn.exists();
- }
-
- @Override
- public void getFileVersions(List<File> scriptFiles, Map<File, FileVersion> versions) {
-
- IProject[] workspaceProjects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- ScriptToProject collection = new ScriptToProject(workspaceProjects);
-
- for (File scriptFile : scriptFiles) {
- collection.add(scriptFile);
- }
-
- ISVNConnector proxy = CoreExtensionsManager.instance().getSVNConnectorFactory().createConnector();
- for (String projectName : collection.getProjectsSet()) {
- try {
- SVNEntryInfo[] st =
- SVNUtility.info(proxy, new SVNEntryRevisionReference(projectName), SVNDepth.INFINITY,
- new SVNNullProgressMonitor());
- for (SVNEntryInfo entry : st) {
- String svnEntryPath = entry.path;
- String itemToMatch = svnEntryPath.substring(svnEntryPath.lastIndexOf("/") + 1);
- File scriptFile = collection.getScriptFileMatch(projectName, itemToMatch);
- if (scriptFile != null) {
- versions.put(scriptFile, new SvnFileVersion(entry));
- }
- }
- } catch (Exception ex) {
- OseeLog.logf(getClass(), Level.SEVERE, "SVNConnectorException while retrieving script SVN info ", ex);
- }
- }
- }
-}

Back to the top