geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdam...@apache.org
Subject cvs commit: incubator-geronimo/modules/system/src/java/org/apache/geronimo/system/configuration LocalConfigStore.java
Date Wed, 04 Aug 2004 07:21:55 GMT
gdamour     2004/08/04 00:21:55

  Modified:    modules/deployment/src/java/org/apache/geronimo/deployment/util
                        FileUtil.java
               modules/system/src/java/org/apache/geronimo/system/configuration
                        LocalConfigStore.java
  Log:
  File.listFiles() may return null.
  
  Revision  Changes    Path
  1.6       +5 -5      incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/util/FileUtil.java
  
  Index: FileUtil.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/util/FileUtil.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FileUtil.java	23 Jul 2004 06:06:19 -0000	1.5
  +++ FileUtil.java	4 Aug 2004 07:21:54 -0000	1.6
  @@ -33,10 +33,7 @@
       private static int i;
   
       public static File toTempFile(InputStream is) throws IOException {
  -        File tmp;
  -       // do {
  -            tmp = File.createTempFile("geronimodeployment" + i++, "tmp");
  -        //} while (tmp.exists());
  +        File tmp = File.createTempFile("geronimodeployment" + i++, "tmp");
           FileOutputStream fos = new FileOutputStream(tmp);
           byte[] buffer = new byte[4096];
           int count;
  @@ -67,6 +64,9 @@
   
       public static void listRecursiveFiles(File aFile, Collection aColl) {
           File[] files = aFile.listFiles();
  +        if ( null == files ) {
  +            return;
  +        }
           for (int i = 0; i < files.length; i++) {
               if ( files[i].isFile() ) {
                   aColl.add(files[i]);
  
  
  
  1.12      +4 -1      incubator-geronimo/modules/system/src/java/org/apache/geronimo/system/configuration/LocalConfigStore.java
  
  Index: LocalConfigStore.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/system/src/java/org/apache/geronimo/system/configuration/LocalConfigStore.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- LocalConfigStore.java	24 Jun 2004 02:50:13 -0000	1.11
  +++ LocalConfigStore.java	4 Aug 2004 07:21:54 -0000	1.12
  @@ -279,6 +279,9 @@
   
       private static void delete(File root) throws IOException {
           File[] files = root.listFiles();
  +        if ( null == files ) {
  +            return;
  +        }
           for (int i = 0; i < files.length; i++) {
               File file = files[i];
               if (file.isDirectory()) {
  
  
  

Mime
View raw message