title: What is the best way to generate a unique and short file name in Java
body: <p>I don't necessarily want to use UUIDs since they are fairly long.</p>
  
  <p>The file just needs to be unique within its directory.</p>
  
  <p>One thought which comes to mind is to use <code>File.createTempFile(String prefix, String suffix)</code>, but that seems wrong because the file is not temporary.</p>
  
  <p>The case of two files created in the same millisecond needs to be handled.</p>