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

Popular posts from this blog

python - rpy2 import is not working -

javascript - How to get MySQL query result returned using $.ajax -

javascript - How to use the code plugin with popcornjs -