org.jboss.virtual.plugins.vfs
Class VirtualFileURLConnection

java.lang.Object
  extended by java.net.URLConnection
      extended by org.jboss.virtual.plugins.vfs.VirtualFileURLConnection

public class VirtualFileURLConnection
extends URLConnection

Implements basic URLConnection for a VirtualFile

Version:
$Revision: 1.1 $
Author:
Bill Burke, Ales Justin

Field Summary
protected  VirtualFile file
           
protected  String relativePath
           
protected  URL vfsurl
           
 
Fields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
 
Constructor Summary
VirtualFileURLConnection(URL url, URL vfsurl, String relativePath)
           
VirtualFileURLConnection(URL url, VirtualFile file)
           
 
Method Summary
 void connect()
           
 VirtualFile getContent()
           
 int getContentLength()
           
 InputStream getInputStream()
           
 long getLastModified()
           
protected  VirtualFile getVirtualFile()
          Get the virtual file.
protected static VirtualFile resolveCachedVirtualFile(URL vfsurl, String relativePath)
           
protected static VirtualFile resolveVirtualFile(URL vfsurl, String relativePath)
           
 
Methods inherited from class java.net.URLConnection
addRequestProperty, getAllowUserInteraction, getConnectTimeout, getContent, getContentEncoding, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderField, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getHeaderFields, getIfModifiedSince, getOutputStream, getPermission, getReadTimeout, getRequestProperties, getRequestProperty, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setConnectTimeout, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setReadTimeout, setRequestProperty, setUseCaches, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

file

protected VirtualFile file

vfsurl

protected URL vfsurl

relativePath

protected String relativePath
Constructor Detail

VirtualFileURLConnection

public VirtualFileURLConnection(URL url,
                                URL vfsurl,
                                String relativePath)

VirtualFileURLConnection

public VirtualFileURLConnection(URL url,
                                VirtualFile file)
Method Detail

connect

public void connect()
             throws IOException
Specified by:
connect in class URLConnection
Throws:
IOException

getContent

public VirtualFile getContent()
                       throws IOException
Overrides:
getContent in class URLConnection
Throws:
IOException

getContentLength

public int getContentLength()
Overrides:
getContentLength in class URLConnection

getLastModified

public long getLastModified()
Overrides:
getLastModified in class URLConnection

getInputStream

public InputStream getInputStream()
                           throws IOException
Overrides:
getInputStream in class URLConnection
Throws:
IOException

resolveCachedVirtualFile

protected static VirtualFile resolveCachedVirtualFile(URL vfsurl,
                                                      String relativePath)
                                               throws IOException
Throws:
IOException

resolveVirtualFile

protected static VirtualFile resolveVirtualFile(URL vfsurl,
                                                String relativePath)
                                         throws IOException
Throws:
IOException

getVirtualFile

protected VirtualFile getVirtualFile()
                              throws IOException
Get the virtual file.

Returns:
the underlying virtual file
Throws:
IOException - for any error


Copyright © 2010 JBoss, A division of Red Hat, Inc. All Rights Reserved.