public class FSPURLConnection extends URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
Constructor and Description |
---|
FSPURLConnection(URL u)
creates a new URL connection with FSP protocol.
|
Modifier and Type | Method and Description |
---|---|
void |
connect()
gets file status from FSP server
throws IOException if there is problem with server communication
|
int |
getConnectTimeout()
Get connection timeout.
|
String |
getContentEncoding()
FSP do not have concept of transfer encodings.
|
int |
getContentLength()
Get content-length.
|
String |
getContentType()
Get content type.
|
long |
getDate()
Get date of sending server.
|
static boolean |
getDefaultAllowUserInteraction()
Returns default value for allowUserInteraction field.
|
boolean |
getDefaultUseCaches()
Returns default value for useCaches.
|
long |
getExpiration()
Get value of Expires: header.
|
String |
getHeaderField(int n)
Returns value of nth header field.
|
String |
getHeaderField(String name)
Returns value of specified header field.
|
long |
getHeaderFieldDate(String name,
long Default)
Return value of header field parsed as date.
|
int |
getHeaderFieldInt(String name,
int Default)
Return value of header field parsed as integer.
|
String |
getHeaderFieldKey(int n)
Return field (header) name for nth header field.
|
Map |
getHeaderFields()
Return unmodifiable Map of header fields.
|
InputStream |
getInputStream()
returns input stream of file from FSPserver.
|
long |
getLastModified()
Return last-modified value for file or 0 if not known
|
OutputStream |
getOutputStream()
Returns an output stream that writes to this URL
|
Permission |
getPermission()
Permission needed for creating connection to this URL
|
boolean |
getUseCaches()
Get value of useCaches property
|
addRequestProperty, getAllowUserInteraction, getContent, getContent, getContentLengthLong, getDefaultRequestProperty, getDoInput, getDoOutput, getFileNameMap, getHeaderFieldLong, getIfModifiedSince, getReadTimeout, getRequestProperties, getRequestProperty, getURL, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setConnectTimeout, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setReadTimeout, setRequestProperty, setUseCaches, toString
public FSPURLConnection(URL u)
u
- FSP URL of targetpublic void connect() throws IOException
connect
in class URLConnection
IOException
public int getConnectTimeout()
getConnectTimeout
in class URLConnection
public String getContentEncoding()
getContentEncoding
in class URLConnection
public int getContentLength()
getContentLength
in class URLConnection
public String getContentType()
getContentType
in class URLConnection
public long getDate()
getDate
in class URLConnection
public static boolean getDefaultAllowUserInteraction()
public boolean getDefaultUseCaches()
getDefaultUseCaches
in class URLConnection
public long getExpiration()
getExpiration
in class URLConnection
public String getHeaderField(int n)
getHeaderField
in class URLConnection
n
- field index, starting at zeropublic String getHeaderField(String name)
Only "last-modified" and "content-length" are supported.
getHeaderField
in class URLConnection
name
- header field name in lower casepublic long getHeaderFieldDate(String name, long Default)
getHeaderFieldDate
in class URLConnection
name
- field name. Only "last-modified" is supportedDefault
- default value returned if no such header existspublic int getHeaderFieldInt(String name, int Default)
getHeaderFieldInt
in class URLConnection
name
- field name. only "content-length" is supportedDefault
- default value returned if no such header existspublic String getHeaderFieldKey(int n)
getHeaderFieldKey
in class URLConnection
n
- field index, starting at zeropublic Map getHeaderFields()
getHeaderFields
in class URLConnection
public InputStream getInputStream() throws IOException
getInputStream
in class URLConnection
IOException
public long getLastModified()
getLastModified
in class URLConnection
public OutputStream getOutputStream()
getOutputStream
in class URLConnection
public Permission getPermission()
getPermission
in class URLConnection
public boolean getUseCaches()
getUseCaches
in class URLConnection
Copyright © 2020 FSP Project. All rights reserved.