Cut a directory?
Is t开发者_JAVA技巧here a method to cut a directory/file in groovy instead of copyingto a new location and then deleting the original directory/file ?
You mean move
a file?
You can do:
File file = new File( 'original.txt' )
File dir = new File( 'destFolder' )
boolean fileMoved = file.renameTo( new File( dir, file.getName() ) )
Which uses the Java File.renameTo method
精彩评论