title: Java isFile(), isDirectory() without checking for existence
body: <p>I want to check if a given String is a file or a directory, i've tried the methods isFile() and isDirectory() of the <a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/io/File.html" rel="noreferrer">File</a> class but the problem is that if the directory or file doesn't exist these methods returns false, because as stated in the javadoc : </p>
  
  <p><strong>isFile()</strong> :</p>
  
  <blockquote>
    <p>true if and only if the file denoted by this abstract pathname exists
    and is a normal file; false otherwise</p>
  </blockquote>
  
  <p><strong>isDirectory()</strong> :</p>
  
  <blockquote>
    <p>true if and only if the file denoted by this abstract pathname exists
    and is a directory; false otherwise</p>
  </blockquote>
  
  <p>Basically <em>i need two methods without the exist clause</em> ... </p>
  
  <p>So i want to test if the given string complies to a directory format or complies to a file format, in a multiplatform context (so, should work on Windows, Linux and Mac Os X).</p>
  
  <p>Does exist some library that provide these methods ? What could be the best implementation of these methods ?</p>
  
  <p><strong>UPDATE</strong> </p>
  
  <p>In the case of a string that could be both(without extension) by default should be identified as directory, if a file with that path does not exist.</p>