I want to create a hidden folder using java application. That program should work across platform. So How to write a program which can create hidden folder.
I have tried using
File newFile = new File("myfile");
newFile.mkdir();
It creates a directory which is not hidden.
解决方案
The concept of hidden files/folders is very OS-specific and not accessible via the Java API.
In Linux, files and folders whose name begins with a dot are hidden per default in many programs - doing that is easy.
In Windows, "hidden" is a special flag stored in the file system. There is no Java API for changing it; you can use Runtime.exec() to run the attrib command.