lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <otis_gospodne...@yahoo.com>
Subject Re: File.isFile() and links
Date Sun, 08 May 2005 02:39:41 GMT
On Fedora Core 3 this returns false when you use it to test a symlink
that points to a directory.  I think the same will be true on all
UNIX-like operating system.  I think Windows and its shortcuts is the
question, and I don't have a Windows machine handy to test.

Otis


--- Daniel Naber <lucenelist@danielnaber.de> wrote:
> 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
> 
> 

---------------------------------------------------------------------
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