portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wea...@apache.org
Subject cvs commit: jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/tools/pamanager DeployUtilities.java
Date Wed, 04 Feb 2004 21:31:18 GMT
weaver      2004/02/04 13:31:18

  Modified:    portal/src/java/org/apache/jetspeed/tools/pamanager
                        DeployUtilities.java
  Log:
  added the public String formatWebApplicationPath(String webAppsDir, String appName)
  method
  
  Revision  Changes    Path
  1.6       +24 -3     jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/tools/pamanager/DeployUtilities.java
  
  Index: DeployUtilities.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/tools/pamanager/DeployUtilities.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DeployUtilities.java	16 Jan 2004 19:47:31 -0000	1.5
  +++ DeployUtilities.java	4 Feb 2004 21:31:18 -0000	1.6
  @@ -111,7 +111,9 @@
   
           log.info("deploying WAR file'" + warFileName + ".war' to WEB-INF/...");
   
  -        String destination = webAppsDir + appName;
  +        
  +
  +        String destination = formatWebApplicationPath(webAppsDir,  appName);
           if (new File(destination).exists())
           {
               throw new IOException(
  @@ -180,7 +182,7 @@
               webModule = webModule.substring(0, webModule.lastIndexOf("."));
   
           // Load web.xml
  -        String webXml = webAppsDir + paName + "/WEB-INF/web.xml";
  +        String webXml = formatWebApplicationPath(webAppsDir, paName)+"/WEB-INF/web.xml";
   
           return webXml;
       }
  @@ -349,6 +351,25 @@
               throw new PortletApplicationException(msg);
           }
   
  +    }
  +	
  +	/**
  +	 * Builds a well-formed relative path to the web application directory
  +	 * that contains the web application defined by the <code>appName</code>
  +	 * @param webAppsDir location of the servlet container's web application directory
  +	 * @param appName name of the web application.
  +	 * @return well-formed relative path to the web application's directory
  +	 */
  +    public String formatWebApplicationPath(String webAppsDir, String appName)
  +    {
  +        if (!appName.startsWith("/") && !webAppsDir.endsWith("/") && !webAppsDir.endsWith("\\"))
  +        {
  +           return webAppsDir + "/" + appName;
  +        }
  +        else
  +        {
  +           return webAppsDir + appName;
  +        }
       }
   
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message