Class FSPURLConnection
-
- All Implemented Interfaces:
public class FSPURLConnection extends URLConnection
class for operations on FSP URL.
- Since:
1.0
Radim Kolar
-
-
Field Summary
Fields Modifier and Type Field Description public static booleandefaultAllowUserInteractionpublic static volatile booleandefaultUseCachespublic intconnectTimeoutpublic intreadTimeoutpublic static volatile FileNameMapfileNameMap
-
Constructor Summary
Constructors Constructor Description FSPURLConnection(URL u)creates a new URL connection with FSP protocol.
-
Method Summary
Modifier and Type Method Description voidconnect()gets file status from FSP server throws IOException if there is problem with server communication intgetConnectTimeout()Get connection timeout. StringgetContentEncoding()FSP do not have concept of transfer encodings. intgetContentLength()Get content-length. StringgetContentType()Get content type. longgetDate()Get date of sending server. static booleangetDefaultAllowUserInteraction()Returns default value for allowUserInteraction field. booleangetDefaultUseCaches()Returns default value for useCaches. longgetExpiration()Get value of Expires: header. StringgetHeaderField(int n)Returns value of nth header field. StringgetHeaderField(String name)Returns value of specified header field. longgetHeaderFieldDate(String name, long Default)Return value of header field parsed as date. intgetHeaderFieldInt(String name, int Default)Return value of header field parsed as integer. StringgetHeaderFieldKey(int n)Return field (header) name for nth header field. MapgetHeaderFields()Return unmodifiable Map of header fields. InputStreamgetInputStream()returns input stream of file from FSPserver. longgetLastModified()Return last-modified value for file or 0 if not known OutputStreamgetOutputStream()Returns an output stream that writes to this URL PermissiongetPermission()Permission needed for creating connection to this URL booleangetUseCaches()Get value of useCaches property -
Methods inherited from class java.net.URLConnection
addRequestProperty, getAllowUserInteraction, getConnectTimeout, getContent, getContentLengthLong, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, 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 -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
FSPURLConnection
FSPURLConnection(URL u)
creates a new URL connection with FSP protocol.
- Parameters:
u- FSP URL of target
-
-
Method Detail
-
connect
void connect()
gets file status from FSP server throws IOException if there is problem with server communication
- Since:
1.0
-
getConnectTimeout
int getConnectTimeout()
Get connection timeout.
- Returns:
FSP session timeout (ms)
- Since:
1.0rc8
-
getContentEncoding
String getContentEncoding()
FSP do not have concept of transfer encodings. All files are transfered in 8bit binary. This encoding is usually called "identity". Because this encoding should not be used in Content-Encoding http/1.1 reply header we return null here.
- Returns:
null
- Since:
1.0rc8
-
getContentLength
int getContentLength()
Get content-length. FSP v2 protocol support files up to 4 GB long. This function is not 64-bit LFS safe, it will return negative number for files 2-4GB long.
- Returns:
file size in bytes
- Since:
1.0rc8
-
getContentType
String getContentType()
Get content type. FSP v2 protocol does not supports content-type.
- Returns:
null - content type not known
- Since:
1.0rc8
-
getDate
long getDate()
Get date of sending server. FSP protocol does not support it.
- Returns:
0
- Since:
1.0rc8
-
getDefaultAllowUserInteraction
static boolean getDefaultAllowUserInteraction()
Returns default value for allowUserInteraction field. Because there is no password support, default value is false.
- Returns:
false
- Since:
1.0rc8
-
getDefaultUseCaches
boolean getDefaultUseCaches()
Returns default value for useCaches. We don't support caches.
- Returns:
false
- Since:
1.0rc8
-
getExpiration
long getExpiration()
Get value of Expires: header. FSP protocol does not support headers.
- Returns:
0
- Since:
1.0rc8
-
getHeaderField
String getHeaderField(int n)
Returns value of nth header field.
- Parameters:
n- field index, starting at zero- Returns:
null if there are fewer than n+1 fields
- Since:
1.0rc8
-
getHeaderField
String getHeaderField(String name)
Returns value of specified header field.
Only "last-modified" and "content-length" are supported.
- Parameters:
name- header field name in lower case- Returns:
header field value or null if no such header is found
- Since:
1.0
-
getHeaderFieldDate
long getHeaderFieldDate(String name, long Default)
Return value of header field parsed as date.
- Parameters:
name- field name.Default- default value returned if no such header exists- Returns:
header value in standard Java time units (ms)
- Since:
1.0rc8
-
getHeaderFieldInt
int getHeaderFieldInt(String name, int Default)
Return value of header field parsed as integer.
- Parameters:
name- field name.Default- default value returned if no such header exists- Returns:
integer value of header
- Since:
1.0rc8
-
getHeaderFieldKey
String getHeaderFieldKey(int n)
Return field (header) name for nth header field.
- Parameters:
n- field index, starting at zero- Returns:
header field name or null if there are fewer than n+1 fields
- Since:
1.0rc8
-
getHeaderFields
Map getHeaderFields()
Return unmodifiable Map of header fields.
- Returns:
Map <String,List<String>>
- Since:
1.0rc8
-
getInputStream
InputStream getInputStream()
returns input stream of file from FSPserver.
- Since:
1.0
-
getLastModified
long getLastModified()
Return last-modified value for file or 0 if not known
- Since:
1.0rc8
-
getOutputStream
OutputStream getOutputStream()
Returns an output stream that writes to this URL
- Since:
1.0rc8
-
getPermission
Permission getPermission()
Permission needed for creating connection to this URL
- Since:
1.0rc8
-
getUseCaches
boolean getUseCaches()
Get value of useCaches property
- Returns:
false. Cache is not supported
- Since:
1.0rc8
-
-
-
-