com.metamatrix.common.protocol.mmfile
Class MMFileURLConnection

java.lang.Object
  extended by java.net.URLConnection
      extended by com.metamatrix.common.protocol.MMURLConnection
          extended by com.metamatrix.common.protocol.mmfile.MMFileURLConnection
Direct Known Subclasses:
MMROFileURLConnection

public class MMFileURLConnection
extends MMURLConnection

Metamatrix's own implementation of the "file:" URL handler. The reason for a different handler is to support the "output stream" as the sun supplied one does not handle writing to it. Strings are not externalized because of the fact that we have huge dependencies with our plugin stuff to eclipse.

Since:
4.4

Field Summary
static java.lang.String DELETED
           
static java.lang.String PROTOCOL
           
 
Fields inherited from class com.metamatrix.common.protocol.MMURLConnection
action, ALPHA, DATE, DELETE, FILE_LIST_SORT, LIST, props, READ, REVERSEALPHA, WRITE
 
Fields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
 
Constructor Summary
MMFileURLConnection(java.net.URL u)
          ctor
MMFileURLConnection(java.net.URL u, boolean readOnly)
           
 
Method Summary
 void connect()
          Marks that connected
 java.io.File getFile()
          Returns the underlying file for this connection.
 java.lang.String getHeaderField(java.lang.String name)
          Provides support for returning the value for the last-modified header.
 java.io.InputStream getInputStream()
           
 long getLastModified()
          Returns the last modified time of the underlying file.
 java.io.OutputStream getOutputStream()
           
 java.security.Permission getPermission()
          Return a permission for reading of the file
 
Methods inherited from class java.net.URLConnection
addRequestProperty, getAllowUserInteraction, getConnectTimeout, getContent, getContent, getContentEncoding, getContentLength, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getHeaderFields, getIfModifiedSince, getReadTimeout, getRequestProperties, getRequestProperty, getURL, getUseCaches, 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, wait, wait, wait
 

Field Detail

PROTOCOL

public static java.lang.String PROTOCOL

DELETED

public static java.lang.String DELETED
Constructor Detail

MMFileURLConnection

public MMFileURLConnection(java.net.URL u)
                    throws java.net.MalformedURLException,
                           java.io.IOException
ctor

Parameters:
u - - URL to open the connection to
Throws:
java.net.MalformedURLException
java.io.IOException

MMFileURLConnection

public MMFileURLConnection(java.net.URL u,
                           boolean readOnly)
                    throws java.net.MalformedURLException,
                           java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException
Method Detail

getFile

public java.io.File getFile()
Returns the underlying file for this connection.


connect

public void connect()
             throws java.io.IOException
Marks that connected

Specified by:
connect in class java.net.URLConnection
Throws:
java.io.IOException

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Overrides:
getInputStream in class java.net.URLConnection
Throws:
java.io.IOException
See Also:
URLConnection.getInputStream()

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Overrides:
getOutputStream in class java.net.URLConnection
Throws:
java.io.IOException
See Also:
URLConnection.getOutputStream()

getHeaderField

public java.lang.String getHeaderField(java.lang.String name)
Provides support for returning the value for the last-modified header.

Overrides:
getHeaderField in class java.net.URLConnection

getPermission

public java.security.Permission getPermission()
                                       throws java.io.IOException
Return a permission for reading of the file

Overrides:
getPermission in class java.net.URLConnection
Throws:
java.io.IOException

getLastModified

public long getLastModified()
Returns the last modified time of the underlying file.

Overrides:
getLastModified in class java.net.URLConnection


Copyright © 2009. All Rights Reserved.