Package org.jboss.virtual.plugins.context.vfs

Source Code of org.jboss.virtual.plugins.context.vfs.AssembledUrlStreamHandler

/*    */ package org.jboss.virtual.plugins.context.vfs;
/*    */
/*    */ import java.io.IOException;
/*    */ import java.net.URL;
/*    */ import java.net.URLConnection;
/*    */ import java.net.URLStreamHandler;
/*    */ import org.jboss.virtual.plugins.vfs.VirtualFileURLConnection;
/*    */ import org.jboss.virtual.spi.VirtualFileHandler;
/*    */
/*    */ public class AssembledUrlStreamHandler extends URLStreamHandler
/*    */ {
/*    */   private final AssembledContext context;
/*    */
/*    */   public AssembledUrlStreamHandler(AssembledContext context)
/*    */   {
/* 44 */     this.context = context;
/*    */   }
/*    */
/*    */   protected URLConnection openConnection(URL url) throws IOException
/*    */   {
/* 49 */     String path = url.getPath();
/* 50 */     VirtualFileHandler vf = this.context.getRoot().findChild(path);
/* 51 */     if (vf == null) {
/* 52 */       throw new IOException(path + " was not found in Assembled VFS context " + this.context.getName());
/*    */     }
/* 54 */     return new VirtualFileURLConnection(url, vf.getVirtualFile());
/*    */   }
/*    */ }

/* Location:           /home/mnovotny/projects/EMBEDDED_JBOSS_BETA3_COMMUNITY/embedded/output/lib/embedded-jboss/lib/jboss-embedded-all.jar
* Qualified Name:     org.jboss.virtual.plugins.context.vfs.AssembledUrlStreamHandler
* JD-Core Version:    0.6.0
*/
TOP

Related Classes of org.jboss.virtual.plugins.context.vfs.AssembledUrlStreamHandler

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.