Class FSPURLConnection

  • All Implemented Interfaces:

    
    public class FSPURLConnection
    extends URLConnection
                        

    class for operations on FSP URL.

    Since:

    1.0

    Author:

    Radim Kolar

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
      FSPURLConnection(URL u) creates a new URL connection with FSP protocol.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method 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
      • 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

      • getLastModified

         long getLastModified()

        Return last-modified value for file or 0 if not known

        Since:

        1.0rc8

      • getUseCaches

         boolean getUseCaches()

        Get value of useCaches property

        Returns:

        false. Cache is not supported

        Since:

        1.0rc8