<p>Does Java impose any extra restrictions of its own. Windows (upto Vista) does not allow names to include</p>

<pre><code>\ / &lt; &gt; ? * :
</code></pre>

<p>I know HOW to validate names (a regular expression).</p>

<p>I need to validate filenames entered by users.  </p>

<p>My application does not need to run on any other platform, though, of course, I would prefer to be platform independent!</p>

[{'answer_id': 63861, 'author': 'jjnguy', 'author_id': 2598, 'author_profile': 'https://Stackoverflow.com/users/2598', 'pm_score': 2, 'selected': False, 'text': "<p>No, you can escape any character that Java doesn't allow in String literals but the filesystem allows.</p>\n\n<p>Also, if trying to port an Windows app to Mac or Unix it is best to use:</p>\n\n<pre><code>File.separator\n</code></pre>\n\n<p>To determine the correct file separator to use on each platform.</p>\n"}, {'answer_id': 63963, 'author': 'Andrew', 'author_id': 7613, 'author_profile': 'https://Stackoverflow.com/users/7613', 'pm_score': 0, 'selected': False, 'text': '<p>When you create a <code>new File</code> the inputted arguments will be normalized by a platform specific implementation of the <code>java.io.FileSystem</code> class. There are no Java specific restrictions that I know of.</p>\n\n<p>and yes, always use <code>File.separator</code>.</p>\n'}, {'answer_id': 63993, 'author': 'Bill Michell', 'author_id': 7938, 'author_profile': 'https://Stackoverflow.com/users/7938', 'pm_score': 0, 'selected': False, 'text': "<p>Java supports any <code>String</code> that can be expressed in Unicode (subject to some ridiculously long maximum length, <code>Integer.MAX_VALUE</code>), and file names are just another kind of <code>String</code>.</p>\n\n<p>Of course, this means that you can try and refer to a file using a name that isn't supported by the underlying Operating System. If you do this, you'll get some kind of <code>IOException</code> when you try and use the File reference...</p>\n"}]
['https://Stackoverflow.com/questions/63800', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8118/']