IConfused
IConfused

Reputation: 724

Hidding Folders using Java in Linux

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.

Upvotes: 2

Views: 71

Answers (1)

BillRobertson42
BillRobertson42

Reputation: 12883

Use File.renameTo.

e.g.

File f = new File("Path to your file");
f.renameTo(".Path to your file");

Upvotes: 1

Related Questions