Hi, there
I want to hide a file in windows 7 using a java.
But I didn't find an effective way to do so.
Can somebody post a sample code to hide a file using java in windows 7?
I'm using JDK 7
Thank you......
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Hi, there
I want to hide a file in windows 7 using a java.
But I didn't find an effective way to do so.
Can somebody post a sample code to hide a file using java in windows 7?
I'm using JDK 7
Thank you......
Please give more detail. You might first try a search with your favorite search engine to see if you get any suggestions and then come back when you can give more info about what you're trying to do. Maybe hiding a file is one of a number of other possible solutions (or not), so if you describe what you're trying to do, someone may have other ideas they could share with you.
Cruger (October 15th, 2013)
@GregBrannon Let's say I have a text file named Main.txt. And I have a java code in Hide.java in the same folder. What I want is when I'm executing the Hide.java I want to hide the Main.txt file.
By searching net I have come up with a code. I tried it to use, But every time I compile the code it gives an error.
Here is the code:
Path path = FileSystems.getDefault().getPath("directory", "hidden.txt");
Boolean hidden = path.getAttribute("dos:hidden", LinkOption.NOFOLLOW_LINKS);
if (hidden != null && !hidden) {
path.setAttribute("dos:hidden", Boolean.TRUE, LinkOption.NOFOLLOW_LINKS);
}
Please make a simple program using this code(or any other way you know). I just want to learn how to make a program to hide a file
Regards
Go read the API doc for the classes and methods you trying to use. The posted code does not compile.
If you don't understand my answer, don't ignore it, ask a question.