|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.net.URLConnection
org.apache.geronimo.system.url.file.FileURLConnection
A URLConnection for the 'file' protocol.
Correctly returns headers.
Field Summary |
Fields inherited from class java.net.URLConnection |
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches |
Constructor Summary | |
FileURLConnection(URL url,
File file)
|
Method Summary | |
void |
connect()
|
int |
getContentLength()
Returns the length of the file. |
String |
getContentType()
Returns the content type of the file as mapped by the filename map. |
long |
getDate()
Returns the last modified time of the file. |
File |
getFile()
|
String |
getHeaderField(int n)
|
String |
getHeaderField(String name)
Get a header field by name. |
String |
getHeaderFieldKey(int n)
|
Map |
getHeaderFields()
Returns supported headers. |
InputStream |
getInputStream()
Return the input stream for the file. |
long |
getLastModified()
Always return the last-modified from the file. |
OutputStream |
getOutputStream()
Return the output stream for the file. |
Permission |
getPermission()
Return the permission for the file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public FileURLConnection(URL url, File file) throws MalformedURLException, IOException
Method Detail |
public File getFile()
public void connect() throws IOException
IOException
public InputStream getInputStream() throws IOException
Sun's URL connections use buffered streams, so we do too.
This impl will return a new stream for each call.
IOException
public OutputStream getOutputStream() throws IOException
Sun's URL connections use buffered streams, so we do too.
This impl will return a new stream for each call.
IOException
public Permission getPermission() throws IOException
Sun's impl always returns "read", but no reason why we can not also write to a file URL, so we do.
IOException
public long getLastModified()
NOTE: Sun's impl caches this value, so it will appear to never change even if the underlying file's last-modified has changed.
public long getDate()
public int getContentLength()
public String getContentType()
public String getHeaderField(String name)
Supported headers:
Hook into our local methods to get headers. URLConnection normally goes the other way around. ie. URLConnection.getDate() calls getHeaderField('date'), but for file usage this is wasteful string creation as normally the getHeaderField() will not be called.
public Map getHeaderFields()
getHeaderField(java.lang.String)
public String getHeaderFieldKey(int n)
public String getHeaderField(int n)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |