[jboss-cvs] JBossAS SVN: r94629 - projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/vfs/spi.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Oct 9 18:43:50 EDT 2009
Author: david.lloyd at jboss.com
Date: 2009-10-09 18:43:50 -0400 (Fri, 09 Oct 2009)
New Revision: 94629
Modified:
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/vfs/spi/AssemblyFileSystem.java
Log:
Must... simplify...
Modified: projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/vfs/spi/AssemblyFileSystem.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/vfs/spi/AssemblyFileSystem.java 2009-10-09 22:26:57 UTC (rev 94628)
+++ projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/vfs/spi/AssemblyFileSystem.java 2009-10-09 22:43:50 UTC (rev 94629)
@@ -47,11 +47,7 @@
/** {@inheritDoc} */
public File getFile(VirtualFile mountPoint, VirtualFile target) throws IOException {
- VirtualFile assemblyFile = assembly.getFile(mountPoint, target);
- if (assemblyFile == null) {
- throw new FileNotFoundException(assemblyFile.getPathName());
- }
- return assemblyFile.getPhysicalFile();
+ return getExistingFile(mountPoint, target).getPhysicalFile();
}
/** {@inheritDoc} */
@@ -104,15 +100,19 @@
/** {@inheritDoc} */
public InputStream openInputStream(VirtualFile mountPoint, VirtualFile target) throws IOException {
- VirtualFile assemblyFile = assembly.getFile(mountPoint, target);
- if (assemblyFile == null) {
- throw new FileNotFoundException(assemblyFile.getPathName());
- }
- return assemblyFile.openStream();
+ return getExistingFile(mountPoint, target).openStream();
}
/** {@inheritDoc} */
public void close() throws IOException {
assembly.close();
}
+
+ private VirtualFile getExistingFile(final VirtualFile mountPoint, final VirtualFile target) throws FileNotFoundException {
+ VirtualFile assemblyFile = assembly.getFile(mountPoint, target);
+ if (assemblyFile == null) {
+ throw new FileNotFoundException(assemblyFile.getPathName());
+ }
+ return assemblyFile;
+ }
}
More information about the jboss-cvs-commits
mailing list