ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb WLRun.java
Date Thu, 12 Jul 2001 12:43:06 GMT
conor       01/07/12 05:43:05

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional/ejb
                        WLRun.java
  Log:
  Allow policy file to exist outside of Weblogic Home
  
  PR:	1161
  
  Revision  Changes    Path
  1.10      +29 -27    jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WLRun.java
  
  Index: WLRun.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WLRun.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- WLRun.java	2001/02/04 08:34:37	1.9
  +++ WLRun.java	2001/07/12 12:43:01	1.10
  @@ -183,29 +183,39 @@
                                        " is not valid");
           }
   
  +        File securityPolicyFile = null;
  +        if (securityPolicy == null) {
  +            securityPolicyFile = new File(weblogicSystemHome, DEFAULT_WL60_POLICY_FILE);
  +        }
  +        else {
  +            securityPolicyFile = new File(weblogicSystemHome, securityPolicy);
  +        }
  +
  +        if (!securityPolicyFile.exists()) {
  +            // OK it maybe an absolute path. Use the project to resolve it
  +            securityPolicyFile = project.resolveFile(securityPolicy);
  +            if (!securityPolicyFile.exists()) {
  +                throw new BuildException("Security policy " + securityPolicy +
  +                                         " was not found.");
  +            }                                         
  +        }
  +
  +
           if (beaHome != null) {
  -            executeWLS6();
  +            executeWLS6(securityPolicyFile);
           }
           else {
  -            executeWLS();
  +            executeWLS(securityPolicyFile);
           }
       }
       
  -    private void executeWLS6() {
  +    private void executeWLS6(File securityPolicyFile) {
           
           if (!beaHome.isDirectory()) {
               throw new BuildException("BEA home " + beaHome.getPath() + 
                                        " is not valid");
           }
           
  -        File securityPolicyFile = null;
  -        if (securityPolicy == null) {
  -            securityPolicyFile = new File(weblogicSystemHome, DEFAULT_WL60_POLICY_FILE);
  -        }
  -        else {
  -            securityPolicyFile = new File(weblogicSystemHome, securityPolicy);
  -        }
  -
           File configFile = new File(weblogicSystemHome, "config/" + weblogicDomainName +
"/config.xml");
           if (!configFile.exists()) {
               throw new BuildException("Server config file " + configFile + " not found.");
  @@ -249,7 +259,7 @@
           }
        }
       
  -    private void executeWLS() {
  +    private void executeWLS(File securityPolicyFile) {
   
           File propertiesFile = null;
           
  @@ -260,21 +270,13 @@
               propertiesFile = new File(weblogicSystemHome, weblogicPropertiesFile);
           }
           if (!propertiesFile.exists()) {
  -            throw new BuildException("Properties file " + weblogicPropertiesFile +
  -                                     " not found in weblogic home " + weblogicSystemHome);
  -        }
  -
  -        File securityPolicyFile = null;
  -        if (securityPolicy == null) {
  -            securityPolicyFile = new File(weblogicSystemHome, DEFAULT_WL51_POLICY_FILE);
  -        }
  -        else {
  -            securityPolicyFile = new File(weblogicSystemHome, securityPolicy);
  -        }
  -        
  -        if (!securityPolicyFile.exists()) {
  -            throw new BuildException("Security policy " + securityPolicyFile +
  -                                     " was not found.");
  +            // OK, properties file may be absolute
  +            propertiesFile = project.resolveFile(weblogicPropertiesFile);
  +            if (!propertiesFile.exists()) {
  +                throw new BuildException("Properties file " + weblogicPropertiesFile +
  +                                         " not found in weblogic home " + weblogicSystemHome
+
  +                                         " or as absolute file");
  +            }                                         
           }
   
           Java weblogicServer = (Java)project.createTask("java");
  
  
  

Mime
View raw message