From scm-return-48375-apmail-geronimo-scm-archive=geronimo.apache.org@geronimo.apache.org Tue May 1 19:12:43 2012 Return-Path: X-Original-To: apmail-geronimo-scm-archive@www.apache.org Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E7BBC9FBB for ; Tue, 1 May 2012 19:12:43 +0000 (UTC) Received: (qmail 35624 invoked by uid 500); 1 May 2012 19:12:43 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 35550 invoked by uid 500); 1 May 2012 19:12:43 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 35541 invoked by uid 99); 1 May 2012 19:12:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 May 2012 19:12:43 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 May 2012 19:12:41 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 94E4A2388865; Tue, 1 May 2012 19:12:21 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1332784 - /geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java Date: Tue, 01 May 2012 19:12:21 -0000 To: scm@geronimo.apache.org From: gawor@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120501191221.94E4A2388865@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: gawor Date: Tue May 1 19:12:21 2012 New Revision: 1332784 URL: http://svn.apache.org/viewvc?rev=1332784&view=rev Log: Document base is non null now so make sure we have the right publish location Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java?rev=1332784&r1=1332783&r2=1332784&view=diff ============================================================================== --- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java (original) +++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java Tue May 1 19:12:21 2012 @@ -1037,8 +1037,23 @@ public class GeronimoServerBehaviourDele } String documentBase = getWebModuleDocumentBase(contextPath); - Trace.tracePoint("Exit", Activator.traceCore, "GeronimoServerBehaviourDelegate.getWebModuleDocumentBase", contextPath, documentBase); - return documentBase; + if (documentBase == null) { + Trace.tracePoint("Exit", Activator.traceCore, "GeronimoServerBehaviourDelegate.getWebModuleDocumentBase", "Document base is not set"); + return null; + } + + File publishLocation = new File(documentBase); + if (!publishLocation.isAbsolute()) { + publishLocation = getServerResource(IGeronimoServerBehavior.VAR_CATALINA_DIR + documentBase).toFile(); + } + + if (!publishLocation.exists()) { + Trace.tracePoint("Exit", Activator.traceCore, "GeronimoServerBehaviourDelegate.getWebModuleDocumentBase", "Document base does not exist", publishLocation); + return null; + } + + Trace.tracePoint("Exit", Activator.traceCore, "GeronimoServerBehaviourDelegate.getWebModuleDocumentBase", contextPath, documentBase, publishLocation); + return publishLocation.getAbsolutePath(); } private IStatus tryFileReplace(IModule[] module) { @@ -1046,8 +1061,8 @@ public class GeronimoServerBehaviourDele IModule webModule = module[module.length - 1]; String documentBase = getWebModuleDocumentBase(webModule); - if (documentBase == null ) { - Trace.tracePoint("Exit", Activator.traceCore, "GeronimoServerBehaviourDelegate.tryFileReplace", "Document base is null"); + if (documentBase == null) { + Trace.tracePoint("Exit", Activator.traceCore, "GeronimoServerBehaviourDelegate.tryFileReplace", "Document base is not set or is invalid"); return null; }