2

I know there are already couple of questions asked but these are not solving my requirements. I need to hide a folder using java. up-till now everything is working fine as I am using Runtime.getRuntime().exec("mv Folder1 .Folder1"); in java but now I am unable to find the solution that how can I hide the folder which has spaces in name.

Note:

  1. moving folders in linux is something different. e.g.

    mv My\ New\ Folder My\ Custom\ Folder

  2. I am using ubuntu.

4

1 回答 1

1

使用File.renameTo

例如

File f = new File("Path to your file");
f.renameTo(".Path to your file");
于 2013-06-17T16:18:56.967 回答