groovy - renameTo() in grails to rename an apk file to zip file -
I want to upload apk files. And then to extract some information, convert it to Zip. I used the renameTo () function but it is not working
string newFilename = "new.apk" New file (f.getOriginalFilename ()) .name (new file (" New.apk "))
(f.getOriginalFilename () will revert the name of an APK file) How can I change the name exactly?
Understand that the given file is given a full path. For example
new file (webRootDir + "/" + [folder name] + "/" + f.originalFilename) .renameTo (new file (webRootDir + "/" + [folder] Name] + "/" + + appname + ".zip"))
will solve the problem.
Comments
Post a Comment