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 GenericDeploymentTool.java
Date Wed, 20 Mar 2002 13:37:05 GMT
conor       02/03/20 05:37:05

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional/ejb
                        GenericDeploymentTool.java
  Log:
  Fix for directory based naming when descriptor in root of descriptor dir
  PR:	4822
  
  Revision  Changes    Path
  1.33      +8 -2      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java
  
  Index: GenericDeploymentTool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -w -u -r1.32 -r1.33
  --- GenericDeploymentTool.java	16 Mar 2002 02:57:11 -0000	1.32
  +++ GenericDeploymentTool.java	20 Mar 2002 13:37:05 -0000	1.33
  @@ -577,8 +577,14 @@
               }
               baseName = descriptorFileName.substring(0, endBaseName);
           } else if (config.namingScheme.getValue().equals(EjbJar.NamingScheme.DIRECTORY))
{
  -            int lastSeparatorIndex = descriptorFileName.lastIndexOf(File.separator);
  -            String dirName = descriptorFileName.substring(0, lastSeparatorIndex);
  +            File descriptorFile = new File(config.descriptorDir, descriptorFileName);
  +            String path = descriptorFile.getAbsolutePath();
  +            int lastSeparatorIndex 
  +                = path.lastIndexOf(File.separator);
  +            if (lastSeparatorIndex == -1) {
  +                throw new BuildException("Unable to determine directory name holding descriptor");
  +            }
  +            String dirName = path.substring(0, lastSeparatorIndex);
               int dirSeparatorIndex = dirName.lastIndexOf(File.separator);
               if (dirSeparatorIndex != -1) {
                   dirName = dirName.substring(dirSeparatorIndex + 1);
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message