Hide a Folder through java application(so that from windows settings also one couldn't able to read the folder)
I have Tried this However i want that from windows explorer also one shouldn't able to watch it.
public static void main(String[] args) throws SecurityException {
Path path = FileSystems.getDefault().getPath("\\rd2");
try {
Files.setAttribute(path, "dos:hidden", true);
} catch (UnsupportedOperationException x) {
System.err.println("DOS file" +
" attributes not supported:" + x);
}
I Have tried this one but not got the result.. can Anyone help me in this problem..
String path="\\r1";
File file = new File(path);
if (!file.exists()) {
if (file.mkdir()) {
file.setReadable(false);
file.setExecutable(false);
file.setWritable(false);
System.out.println("Directory is created!");
} else {
System.out.println("Failed to create directory!");
}
}
can Anyone help me in this problem..