Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto E. Escobar2014-11-18 20:44:14 +0000
committerAngel Avila2014-11-18 20:44:14 +0000
commitbe3e2b8fbbbfe610e0498fcb4a3aa5595e046e83 (patch)
tree37c6a5a3c45bdfeb4d93af67e7ddd882bcae1b37 /plugins/org.eclipse.osee.framework.manager.servlet
parente8a56b2efeef8704d17346b79c561ff1ba9680ca (diff)
downloadorg.eclipse.osee-be3e2b8fbbbfe610e0498fcb4a3aa5595e046e83.tar.gz
org.eclipse.osee-be3e2b8fbbbfe610e0498fcb4a3aa5595e046e83.tar.xz
org.eclipse.osee-be3e2b8fbbbfe610e0498fcb4a3aa5595e046e83.zip
feature: Remove DefaultOseeArtifact from legacy file servlet
Diffstat (limited to 'plugins/org.eclipse.osee.framework.manager.servlet')
-rw-r--r--plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/ArtifactFileServlet.java30
-rw-r--r--plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/data/DefaultOseeArtifact.java40
2 files changed, 8 insertions, 62 deletions
diff --git a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/ArtifactFileServlet.java b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/ArtifactFileServlet.java
index 4c4f1dd73e2..2274fff7131 100644
--- a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/ArtifactFileServlet.java
+++ b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/ArtifactFileServlet.java
@@ -21,13 +21,11 @@ import org.eclipse.osee.framework.core.exception.OseeExceptions;
import org.eclipse.osee.framework.core.server.UnsecuredOseeHttpServlet;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.jdk.core.type.Pair;
import org.eclipse.osee.framework.jdk.core.type.PropertyStore;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.manager.servlet.data.ArtifactUtil;
-import org.eclipse.osee.framework.manager.servlet.data.DefaultOseeArtifact;
import org.eclipse.osee.framework.resource.management.IResource;
import org.eclipse.osee.framework.resource.management.IResourceLocator;
import org.eclipse.osee.framework.resource.management.IResourceManager;
@@ -65,28 +63,16 @@ public class ArtifactFileServlet extends UnsecuredOseeHttpServlet {
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
try {
-
- String branchName = null, artifactGuid = null;
Long branchUuid = null;
-
- String servletPath = request.getServletPath();
- if (!Strings.isValid(servletPath) || "/".equals(servletPath) || "/index".equals(servletPath)) {
- Pair<String, Long> defaultArtifact = DefaultOseeArtifact.get();
- if (defaultArtifact != null) {
- artifactGuid = defaultArtifact.getFirst();
- branchUuid = defaultArtifact.getSecond();
- }
+ String artifactGuid = request.getParameter(GUID_KEY);
+ String branchName = request.getParameter(BRANCH_NAME_KEY);
+ String branchGuid = request.getParameter(BRANCH_GUID_KEY);
+ if (branchGuid != null) {
+ getLogger().warn("Request with branch guid instead of uuid [%s]",
+ request.getRequestURL().append('?').append(request.getQueryString()));
+ branchUuid = extractBranchUuid(branchGuid);
} else {
- artifactGuid = request.getParameter(GUID_KEY);
- branchName = request.getParameter(BRANCH_NAME_KEY);
- String branchGuid = request.getParameter(BRANCH_GUID_KEY);
- if (branchGuid != null) {
- getLogger().warn("Request with branch guid instead of uuid [%s]",
- request.getRequestURL().append('?').append(request.getQueryString()));
- branchUuid = extractBranchUuid(branchGuid);
- } else {
- branchUuid = Long.parseLong(request.getParameter(BRANCH_UUID_KEY));
- }
+ branchUuid = Long.parseLong(request.getParameter(BRANCH_UUID_KEY));
}
String uri = null;
diff --git a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/data/DefaultOseeArtifact.java b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/data/DefaultOseeArtifact.java
deleted file mode 100644
index c7ada75b55a..00000000000
--- a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/data/DefaultOseeArtifact.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.framework.manager.servlet.data;
-
-import org.eclipse.osee.framework.database.core.OseeInfo;
-import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
-import org.eclipse.osee.framework.jdk.core.type.Pair;
-import org.eclipse.osee.framework.jdk.core.util.Strings;
-
-/**
- * Retrieves the default OSEE server page
- *
- * @author Roberto E. Escobar
- */
-public class DefaultOseeArtifact {
-
- private static String OSEE_DEFAULT_SERVER_PAGE_GUID_KEY = "osee.default.server.page.guid";
- private static String OSEE_DEFAULT_SERVER_PAGE_BRANCH_UUID = "osee.default.server.page.branch.uuid";
-
- public static Pair<String, Long> get() throws Exception {
-
- final String artifactGuid = OseeInfo.getValue(OSEE_DEFAULT_SERVER_PAGE_GUID_KEY);
- final String defaultBranchUuidId = OseeInfo.getValue(OSEE_DEFAULT_SERVER_PAGE_BRANCH_UUID);
-
- if (!Strings.isValid(artifactGuid) || !Strings.isValid(defaultBranchUuidId)) {
- throw new OseeStateException(
- "OSEE default server page not found. Ensure values exist in OseeInfo table for [%s] and [%s] keys.",
- OSEE_DEFAULT_SERVER_PAGE_GUID_KEY, OSEE_DEFAULT_SERVER_PAGE_BRANCH_UUID);
- }
- return new Pair<String, Long>(artifactGuid, Long.valueOf(defaultBranchUuidId));
- }
-}

Back to the top