[jboss-cvs] container/src/main/org/jboss/vfs/file ...
Scott Stark
scott.stark at jboss.com
Sat Jul 15 10:08:42 EDT 2006
User: starksm
Date: 06/07/15 10:08:42
Modified: src/main/org/jboss/vfs/file FileImpl.java
Log:
Throw a FileNotFoundException if the underlying file does not exist
Revision Changes Path
1.7 +8 -2 container/src/main/org/jboss/vfs/file/FileImpl.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: FileImpl.java
===================================================================
RCS file: /cvsroot/jboss/container/src/main/org/jboss/vfs/file/FileImpl.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- FileImpl.java 14 Jul 2006 23:32:10 -0000 1.6
+++ FileImpl.java 15 Jul 2006 14:08:42 -0000 1.7
@@ -27,7 +27,7 @@
/** A java.io.File based implementation of VirtualFile
*
* @author Scott.Stark at jboss.org
- * @version $Revision: 1.6 $
+ * @version $Revision: 1.7 $
*/
public class FileImpl
implements VirtualFile, Serializable
@@ -49,17 +49,23 @@
private transient InputStream contentIS;
public FileImpl(URL path, String vfsPath, FileSystemVFS vfs)
+ throws IOException
{
this.path = path;
this.vfsPath = vfsPath;
this.file = new File(path.getPath());
+ if( file.exists() == false )
+ throw new FileNotFoundException(file.getCanonicalPath());
this.vfs = vfs;
}
- public FileImpl(File file, String vfsPath, FileSystemVFS vfs) throws MalformedURLException
+ public FileImpl(File file, String vfsPath, FileSystemVFS vfs)
+ throws IOException
{
this.path = file.toURL();
this.vfsPath = vfsPath;
this.file = file;
+ if( file.exists() == false )
+ throw new FileNotFoundException(file.getCanonicalPath());
this.vfs = vfs;
}
More information about the jboss-cvs-commits
mailing list