Ultimately, what symbols are allowed will depend on the local filesystem/OS. However, Java will check for you whether the filename is valid and throw an IOException if it isn't, when you try to create the file via createNewFile()
for example. So stuff either won't go wrong or you'll be presented with an exception which you should handle.
See the Wikipedia page on filenames for more details on what's allowed and what's not in different OS/filesystems.