Java Mailing List Archive

http://www.gg3721.com/

Home » user.groovy »

[groovy-user] Re[groovy-user] turn Doesn't apear to work from the Each()

SophosGuy

2008-08-19

Replies: Find Java Web Hosting

Author LoginPost Reply

I could just not know how closures work but why do I get this response I even
tried adding a return before the closure but no dice

FileName:IN
text
text
FileText:[Ljava.io.File;@(protected)

from this code
public static void main(args)
 {
   Config test = new Config()
   println "FileName:${test.getInFolder().name}"
    FileRetriever fileRet = new FileRetriever()
    println "FileText:${fileRet.getLibraryOrderFile()}"
  }
public String getLibraryOrderFile()
 {
    File configIn = config.getInFolder()
    def fileText=""
    if (!config.getInFolder())
   {
     return
   }
    def returnValue
    configIn.listFiles().each { file ->
       def root = new XmlSlurper().parse(file.newInputStream())
       if(root?.message?.@(protected)"))
       {
          println root.toString()
          return root.toString()
       }
    }
  }


--
Sent from the groovy - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email


©2008 gg3721.com - Jax Systems, LLC, U.S.A.