You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Daniel Naber <lu...@danielnaber.de> on 2005/05/07 00:55:26 UTC
File.isFile() and links
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