显示文件列表的groovy脚本

<!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --> if ( this .args.length){
    dir 
=   new  File( this .args[ 0 ])
    
if (dir.exists()  &&  dir.directory){
        dir.eachDirRecurse{it 
->
            it.listFiles().each{ f
->
                
if ( ! f.directory){
                    println f.absolutePath;
                }
            }
        }
    } 
else  {
        println 
" ${this.args[0]} is not a directory. "
    }
else  {
    println 
" Use: groovy ListFile.groovy <dir> "
}

你可能感兴趣的:(groovy)