What i would like to know is if their is a way i can do this transparently so that the user cannot edit these files, or find them.
Ultimately, no.
Anything that you do to store state on the local machine can ultimately be reverse engineered and that state can be retrieved by a privileged user.
But there are various things you could do to make it difficult for people to "cheat". For instance, you could encrypt the file, or generate a seeded hash to detect "tinkering".
Hiding files on Java 7 is simple:
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);
}
(Copied from: http://javarevisited.blogspot.com/2012/01/how-to-hide-file-java-program-example.html)
On earlier versions of Java you needed to call an external Windows application or call a native library to do it. But note that:
- "hidden" files are only hidden from users who don't bother to look
- they work differently on different platforms; e.g. for Linux/Unix based systems, "hidden" just means that the filename starts with a ".".