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.URLConnectionProvides 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 booleandecodeFilePathsprotected java.io.FilefileThe underlying file(package private) static booleanuseURI
-
Constructor Summary
Constructors Constructor Description FileURLConnection(java.net.URL url)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconnect()Checks if the underlying file for this connection exists.java.io.FilegetFile()Returns the underlying file for this connection.java.lang.StringgetHeaderField(java.lang.String name)Provides support for the following headers: last-modified content-length content-type datejava.io.InputStreamgetInputStream()longgetLastModified()Returns the last modified time of the underlying file.java.io.OutputStreamgetOutputStream()java.security.PermissiongetPermission()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.IOExceptionChecks if the underlying file for this connection exists.- Specified by:
connectin classjava.net.URLConnection- Throws:
java.io.FileNotFoundExceptionjava.io.IOException
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOException- Overrides:
getInputStreamin classjava.net.URLConnection- Throws:
java.io.IOException
-
getOutputStream
public java.io.OutputStream getOutputStream() throws java.io.IOException- Overrides:
getOutputStreamin 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:
getHeaderFieldin classjava.net.URLConnection
-
getPermission
public java.security.Permission getPermission() throws java.io.IOExceptionReturn a permission for reading of the file- Overrides:
getPermissionin classjava.net.URLConnection- Throws:
java.io.IOException
-
getLastModified
public long getLastModified()
Returns the last modified time of the underlying file.- Overrides:
getLastModifiedin classjava.net.URLConnection
-
-