org.jboss.net.protocol.file
Class FileURLConnection

java.lang.Object
  extended byjava.net.URLConnection
      extended byorg.jboss.net.protocol.file.FileURLConnection

public class FileURLConnection
extends java.net.URLConnection

Provides local file access via URL semantics, correctly returning the last modified time of the underlying file.


Field Summary
protected  java.io.File file
           
 
Fields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
 
Constructor Summary
FileURLConnection(java.net.URL url)
           
 
Method Summary
 void connect()
          Checks if the underlying file for this connection exists.
 java.io.File getFile()
          Returns the underlying file for this connection.
 java.lang.String getHeaderField(java.lang.String name)
          Provides support for returning the value for the last-modified header.
 java.io.InputStream getInputStream()
           
 long getLastModified()
          Returns the last modified time of the underlying file.
 java.io.OutputStream getOutputStream()
           
 java.security.Permission getPermission()
          Return a permission for reading of the file
 
Methods inherited from class java.net.URLConnection
addRequestProperty, getAllowUserInteraction, getContent, getContent, getContentEncoding, getContentLength, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getHeaderFields, getIfModifiedSince, getRequestProperties, getRequestProperty, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setRequestProperty, setUseCaches, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

file

protected java.io.File file
Constructor Detail

FileURLConnection

public FileURLConnection(java.net.URL url)
                  throws java.net.MalformedURLException,
                         java.io.IOException
Method Detail

getFile

public java.io.File getFile()
Returns the underlying file for this connection.


connect

public void connect()
             throws java.io.IOException
Checks if the underlying file for this connection exists.

Throws:
java.io.FileNotFoundException
java.io.IOException

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Throws:
java.io.IOException

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Throws:
java.io.IOException

getHeaderField

public java.lang.String getHeaderField(java.lang.String name)
Provides support for returning the value for the last-modified header.


getPermission

public java.security.Permission getPermission()
                                       throws java.io.IOException
Return a permission for reading of the file

Throws:
java.io.IOException

getLastModified

public long getLastModified()
Returns the last modified time of the underlying file.