You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by um...@apache.org on 2002/09/03 17:05:58 UTC

cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Expand.java

umagesh     2002/09/03 08:05:58

  Modified:    src/main/org/apache/tools/ant/taskdefs Tag: ANT_15_BRANCH
                        Expand.java
  Log:
  getParentFile may return null.
  
  Reported by: Bayyapu, Pavan <pa...@sap.com>
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.30.2.2  +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.30.2.1
  retrieving revision 1.30.2.2
  diff -u -r1.30.2.1 -r1.30.2.2
  --- Expand.java	21 May 2002 12:59:06 -0000	1.30.2.1
  +++ Expand.java	3 Sep 2002 15:05:58 -0000	1.30.2.2
  @@ -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(project);
                   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(project);
                   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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>