Package org.jboss.net.protocol.file
Class FileURLConnection
- java.lang.Object
-
- java.net.URLConnection
-
- org.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.- Version:
- $Revision$
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static boolean
decodeFilePaths
protected java.io.File
file
The underlying file(package private) static boolean
useURI
-
Constructor Summary
Constructors Constructor Description FileURLConnection(java.net.URL url)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 the following headers: last-modified content-length content-type datejava.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, getConnectTimeout, getContent, getContent, getContentEncoding, getContentLength, getContentLengthLong, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getHeaderFieldLong, getHeaderFields, getIfModifiedSince, getReadTimeout, getRequestProperties, getRequestProperty, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setConnectTimeout, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setReadTimeout, setRequestProperty, setUseCaches, toString
-
-
-
-
Method Detail
-
getFile
public java.io.File getFile()
Returns the underlying file for this connection.- Returns:
- the file
-
connect
public void connect() throws java.io.IOException
Checks if the underlying file for this connection exists.- Specified by:
connect
in classjava.net.URLConnection
- Throws:
java.io.FileNotFoundException
java.io.IOException
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOException
- Overrides:
getInputStream
in classjava.net.URLConnection
- Throws:
java.io.IOException
-
getOutputStream
public java.io.OutputStream getOutputStream() throws java.io.IOException
- Overrides:
getOutputStream
in classjava.net.URLConnection
- Throws:
java.io.IOException
-
getHeaderField
public java.lang.String getHeaderField(java.lang.String name)
Provides support for the following headers: last-modified content-length content-type date- Overrides:
getHeaderField
in classjava.net.URLConnection
-
getPermission
public java.security.Permission getPermission() throws java.io.IOException
Return a permission for reading of the file- Overrides:
getPermission
in classjava.net.URLConnection
- Throws:
java.io.IOException
-
getLastModified
public long getLastModified()
Returns the last modified time of the underlying file.- Overrides:
getLastModified
in classjava.net.URLConnection
-
-