lucene-dev mailing list archives

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

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.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message