A
Alex
How do I check if a filename is valid in java i.e. if it has the permitted
characters of a filename?
characters of a filename?
FileFilter or FileNameFilter. For example, you can get filtered fileAlex said:How do I check if a filename is valid in java i.e. if it has the permitted
characters of a filename?
Alex said:I probably didn't make my question specific enough...
How do I test if a filename is accepted by the local file system?
- For example a file with filename "1aa" will not be accepted in windows
because it starts
with a number.
Alex said:Yes that's what I think I'll have to do - even though I don't consider that
'good' programming practice. I was hoping java would have something better
in the API. I'm writing an app which will write to Linux and Windows
partitions at the same time so it needs to check for both OSes.
Alex said:bad example....
a file with filename "aa?" will not be accepted 'cos it has a question mark
Alex said:Yes that's what I think I'll have to do - even though I don't consider that
'good' programming practice. I was hoping java would have something better
in the API. I'm writing an app which will write to Linux and Windows
partitions at the same time so it needs to check for both OSes.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.