Is Java imposing additional restrictions on file names other than the underlying operating system?

Does Java provide any additional restrictions. Windows (before Vista) does not allow names to include

\ / < > ? * :

I know HOW to check names (regular expression).

I need to check the file names entered by users.

My application does not need to be run on any other platform, although, of course, I would prefer to be platform independent!

+5
source share
3 answers

No, you can avoid any character that Java does not allow in string literals, but the file system allows.

, Windows Mac Unix :

File.separator

.

+2

new File, java.io.FileSystem. Java.

, File.separator.

0

Java String, ( - , Integer.MAX_VALUE), - String.

, , , , . , - IOException ...

0

All Articles