You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by im...@apache.org on 2006/02/17 12:51:49 UTC
svn commit: r378488 -
/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/local/LocalFile.java
Author: imario
Date: Fri Feb 17 03:51:44 2006
New Revision: 378488
URL: http://svn.apache.org/viewcvs?rev=378488&view=rev
Log:
PR: 38105
Changed to treat a file as file it is a special file like socket or fifo.
Treat a file as file even if java.io.File.exists() returns false but its length is > 0 (hiberfil.sys on windows)
Thanks to Robert and Anton for pointing it out
Modified:
jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/local/LocalFile.java
Modified: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/local/LocalFile.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/local/LocalFile.java?rev=378488&r1=378487&r2=378488&view=diff
==============================================================================
--- jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/local/LocalFile.java (original)
+++ jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/local/LocalFile.java Fri Feb 17 03:51:44 2006
@@ -81,20 +81,25 @@
protected FileType doGetType()
throws Exception
{
- if (!file.exists())
+ // JDK BUG: 6192331
+ // if (!file.exists())
+ if (!file.exists() && file.length() == 0)
{
return FileType.IMAGINARY;
}
- else if (file.isDirectory())
+
+ if (file.isDirectory())
{
return FileType.FOLDER;
}
- else if (file.isFile())
- {
+
+ // In doubt, treat an existing file as file
+ // if (file.isFile())
+ // {
return FileType.FILE;
- }
+ // }
- throw new FileSystemException("vfs.provider.local/get-type.error", file);
+ // throw new FileSystemException("vfs.provider.local/get-type.error", file);
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org