org.jboss.net.protocol.file
Class FileURLConnection

java.lang.Object
  extended by java.net.URLConnection
      extended by org.jboss.net.protocol.file.FileURLConnection

public class FileURLConnection
extends URLConnection

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

Version:
$Revision: 1.9.4.5 $
Author:
Jason Dillon, Scott.Stark

Field Summary
protected  File file
           
 
Fields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
 
Constructor Summary
FileURLConnection(URL url)
           
 
Method Summary
 void connect()
          Checks if the underlying file for this connection exists.
 File getFile()
          Returns the underlying file for this connection.
 String getHeaderField(String name)
          Provides support for returning the value for the last-modified header.
 InputStream getInputStream()
           
 long getLastModified()
          Returns the last modified time of the underlying file.
 OutputStream getOutputStream()
           
 Permission getPermission()
          Return a permission for reading of the file
 
Methods inherited from class java.net.URLConnection
addRequestProperty, getAllowUserInteraction, getConnectTimeout, getContent, getContent, getContentEncoding, getContentLength, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getHeaderFields, getIfModifiedSince, 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 File file
Constructor Detail

FileURLConnection

public FileURLConnection(URL url)
                  throws MalformedURLException,
                         IOException
Throws:
MalformedURLException
IOException
Method Detail

getFile

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


connect

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

Specified by:
connect in class URLConnection
Throws:
FileNotFoundException
IOException

getInputStream

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

getOutputStream

public OutputStream getOutputStream()
                             throws IOException
Overrides:
getOutputStream in class URLConnection
Throws:
IOException

getHeaderField

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

Overrides:
getHeaderField in class URLConnection

getPermission

public Permission getPermission()
                         throws IOException
Return a permission for reading of the file

Overrides:
getPermission in class URLConnection
Throws:
IOException

getLastModified

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

Overrides:
getLastModified in class URLConnection


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.