activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1154619 - /activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/FileSupport.scala
Date Sat, 06 Aug 2011 23:04:20 GMT
Author: chirino
Date: Sat Aug  6 23:04:19 2011
New Revision: 1154619

URL: http://svn.apache.org/viewvc?rev=1154619&view=rev
Log:
Add helper which returns an empty array if the fileList op returns null.

Modified:
    activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/FileSupport.scala

Modified: activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/FileSupport.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/FileSupport.scala?rev=1154619&r1=1154618&r2=1154619&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/FileSupport.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/FileSupport.scala
Sat Aug  6 23:04:19 2011
@@ -48,6 +48,10 @@ object FileSupport {
       }
     }
 
+    def list_files:Array[File] = {
+      Option(self.listFiles()).getOrElse(Array())
+    }
+
     def recursive_list:List[File] = {
       if( self.isDirectory ) {
         self :: self.listFiles.toList.flatten( _.recursive_list )



Mime
View raw message