org.gnu.jcifs.www.cifs
Class CifsURLConnection

java.lang.Object
  |
  +--java.net.URLConnection
        |
        +--org.gnu.jcifs.www.cifs.CifsURLConnection

public class CifsURLConnection
extends java.net.URLConnection

CifsURLConnection implements the "cifs" protocol connection. The URL syntax is:

cifs://[user[:password]@]host/path

Since:
1.1

Method Summary
 void connect()
          Opens a communications link to the CIFS file referenced by this URL, if such a connection has not already been established.
 int getContentLength()
           
 java.lang.String getContentType()
          Returns the value of the content-type
 java.io.InputStream getInputStream()
          Returns an input stream that reads from this open connection.
 java.io.OutputStream getOutputStream()
          Returns an output stream that writes to this connection.
 
Methods inherited from class java.net.URLConnection
getAllowUserInteraction, getContent, getContentEncoding, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderField, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getIfModifiedSince, getLastModified, getPermission, getRequestProperty, getURL, getUseCaches, guessContentTypeFromStream, setAllowUserInteraction, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setRequestProperty, setUseCaches, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

connect

public void connect()
             throws java.io.IOException
Opens a communications link to the CIFS file referenced by this URL, if such a connection has not already been established.

If the connect method is called when the connection has already been opened (indicated by the connected field having the value true), the call is ignored.

CifsURLConnection objects go through two phases: first they are created, then they are connected. After being created, and before being connected, various options can be specified (e.g., doInput). After connecting, it is an error to try to set them. Operations that depend on being connected, like getContentLength, will implicitly perform the connection, if necessary.

Overrides:
connect in class java.net.URLConnection
Throws:
java.io.IOException - if an I/O error occurs while opening the connection.

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Returns an input stream that reads from this open connection.
Overrides:
getInputStream in class java.net.URLConnection
Returns:
an input stream that reads from this open connection.
Throws:
java.io.IOException - if an I/O error occurs while creating the input stream.

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Returns an output stream that writes to this connection. The method setDoOutput(true) must be called to allow writing.
Overrides:
getOutputStream in class java.net.URLConnection
Returns:
an output stream that writes to this connection.
Throws:
java.io.IOException - if an I/O error occurs while creating the output stream.

getContentType

public java.lang.String getContentType()
Returns the value of the content-type
Overrides:
getContentType in class java.net.URLConnection
Returns:
the content type of the resource that the URL references, or null if not known.

getContentLength

public int getContentLength()
Overrides:
getContentLength in class java.net.URLConnection

Norbert Hranitzky