lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Naber <lucenel...@danielnaber.de>
Subject File.isFile() and links
Date Fri, 06 May 2005 22:55:26 GMT
Hi,

I'd like to add this code to FSDirectory.create():

    if (directory.isFile())
      throw new IOException("Expected directory, but '" + directory + "' is 
          a file");

This way people will get a useful exception if they specify a file instead 
of a directory (currently this leads to a NPE). Of course it should still 
be possible to specify a link that points to a directory. I tried it here 
(Suse Linux 9.1) and it works. But will it work on other systems? The 
Javadoc of the File class doesn't say whether a link is a file or not.

Regards
 Daniel

-- 
http://www.danielnaber.de

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message