
I would be glad if anyone could help me set file attributes in java I would like to know how to set the hidden file attribute or the read only file attribute. Thank you

Let me know the specific line of code that's giving the error elimence@gmail.com

Hi,
There is no API to make a file hidden in Java. To make a file hidden from the java program you will have to useRuntime.getRuntime().exec() method.
Here is the example of making a file hidden from Java program.
Runtime.getRuntime().exec("attrib +H myHiddenJavafile.java");
You make a file read only from Java program. Here is the code example to make a file read only.
File file=new File("d:\\myeadonlyfile.txt");
file.setReadOnly();
Thanks

Hi,
Here is an example of java code to determine weather a file in Hidden or not.
Read at How to check a file is hidden or not in java.
Thanks

Hi,
Here is an example of java code to determine weather a file in Hidden or not.
Read at How to check a file is hidden or not in java.
Thanks