ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From umag...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Expand.java
Date Tue, 03 Sep 2002 15:06:57 GMT
umagesh     2002/09/03 08:06:57

  Modified:    src/main/org/apache/tools/ant/taskdefs Expand.java
  Log:
  getParentFile may return null.
  
  Reported by: Bayyapu, Pavan <pavan.bayyapu@sap.com>
  
  Revision  Changes    Path
  1.35      +6 -4      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Expand.java
  
  Index: Expand.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Expand.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- Expand.java	25 Jul 2002 15:21:04 -0000	1.34
  +++ Expand.java	3 Sep 2002 15:06:57 -0000	1.35
  @@ -146,7 +146,7 @@
        * This method is to be overridden by extending unarchival tasks.
        */
       protected void expandFile(FileUtils fileUtils, File srcF, File dir) {
  -        log("Expanding: " + srcF + " into " + dir, Project.MSG_INFO);        
  +        log("Expanding: " + srcF + " into " + dir, Project.MSG_INFO);
           ZipInputStream zis = null;
           try {
               // code from WarExpand
  @@ -186,7 +186,7 @@
                   String[] incls = p.getIncludePatterns(getProject());
                   if (incls != null) {
                       for (int w = 0; w < incls.length; w++) {
  -                        boolean isIncl = 
  +                        boolean isIncl =
                               DirectoryScanner.match(incls[w], name);
                           if (isIncl) {
                               included = true;
  @@ -197,7 +197,7 @@
                   String[] excls = p.getExcludePatterns(getProject());
                   if (excls != null) {
                       for (int w = 0; w < excls.length; w++) {
  -                        boolean isExcl = 
  +                        boolean isExcl =
                               DirectoryScanner.match(excls[w], name);
                           if (isExcl) {
                               included = false;
  @@ -225,7 +225,9 @@
                   Project.MSG_VERBOSE);
               // create intermediary directories - sometimes zip don't add them
               File dirF = fileUtils.getParentFile(f);
  -            dirF.mkdirs();
  +            if ( dirF != null ) {
  +                dirF.mkdirs();
  +            }
   
               if (isDirectory) {
                   f.mkdirs();
  
  
  

--
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