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 Tue, 21 Aug 2001 02:43:51 GMT
conor       01/08/20 19:43:51

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional/ejb Tag:
                        ANT_14_BRANCH WLRun.java
  Log:
  Fix up selection of security policy file
  
  Submitted by:	Mike Williams [mikew@cortexebusiness.com.au]
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.10.2.2  +23 -23    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.10.2.1
  retrieving revision 1.10.2.2
  diff -u -r1.10.2.1 -r1.10.2.2
  --- WLRun.java	2001/08/15 23:16:06	1.10.2.1
  +++ WLRun.java	2001/08/21 02:43:51	1.10.2.2
  @@ -183,34 +183,34 @@
                                        " is not valid");
           }
   
  -        File securityPolicyFile = null;
  -        if (securityPolicy == null) {
  -            securityPolicyFile = new File(weblogicSystemHome, DEFAULT_WL60_POLICY_FILE);
  +        if (beaHome != null) {
  +            executeWLS6();
  +        } else {
  +            executeWLS();
           }
  -        else {
  -            securityPolicyFile = new File(weblogicSystemHome, securityPolicy);
  +    }
  +    
  +    private File findSecurityPolicyFile(String defaultSecurityPolicy) {
  +        String securityPolicy = this.securityPolicy;
  +        if (securityPolicy == null) {
  +            securityPolicy = defaultSecurityPolicy;
           }
  -
  -        if (!securityPolicyFile.exists()) {
  -            // OK it maybe an absolute path. Use the project to resolve it
  +        File securityPolicyFile = new File( weblogicSystemHome, securityPolicy );
  +        // If an explicit securityPolicy file was specified, it maybe an
  +        // absolute path.  Use the project to resolve it.
  +        if (this.securityPolicy != null && !securityPolicyFile.exists()) {
               securityPolicyFile = project.resolveFile(securityPolicy);
  -            if (!securityPolicyFile.exists()) {
  -                throw new BuildException("Security policy " + securityPolicy +
  -                                         " was not found.");
  -            }                                         
           }
  -
  -
  -        if (beaHome != null) {
  -            executeWLS6(securityPolicyFile);
  -        }
  -        else {
  -            executeWLS(securityPolicyFile);
  +        // If we still can't find it, complain
  +        if (!securityPolicyFile.exists()) {
  +            throw new BuildException("Security policy " + securityPolicy +
  +                                     " was not found.");
           }
  +        return securityPolicyFile;
       }
       
  -    private void executeWLS6(File securityPolicyFile) {
  -        
  +    private void executeWLS6() {
  +        File securityPolicyFile = findSecurityPolicyFile( DEFAULT_WL60_POLICY_FILE );
           if (!beaHome.isDirectory()) {
               throw new BuildException("BEA home " + beaHome.getPath() + 
                                        " is not valid");
  @@ -259,8 +259,8 @@
           }
        }
       
  -    private void executeWLS(File securityPolicyFile) {
  -
  +    private void executeWLS() {
  +        File securityPolicyFile = findSecurityPolicyFile( DEFAULT_WL51_POLICY_FILE );
           File propertiesFile = null;
           
   
  
  
  

Mime
View raw message