javax.activation
类 URLDataSource

java.lang.Object
  继承者 javax.activation.URLDataSource
所有已实现的接口:
DataSource

public class URLDataSource
extends Object
implements DataSource

版本:
$Rev: 467742 $ $Date: 2011/05/07 04:32:39 $

构造方法摘要
URLDataSource(URL url)
          Creates a URLDataSource from a URL object.
 
方法摘要
 String getContentType()
          Returns the value of the URL content-type header field.
 InputStream getInputStream()
          Returns an InputStream obtained from the URL.
 String getName()
          Returns the file name of the URL object.
 OutputStream getOutputStream()
          Returns an OutputStream obtained from the URL.
 URL getURL()
          Returns the URL of the data source.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

URLDataSource

public URLDataSource(URL url)
Creates a URLDataSource from a URL object.

方法详细信息

getContentType

public String getContentType()
Returns the value of the URL content-type header field. This method calls URL.openConnection() to obtain a connection from which to obtain the content type. If this fails or a getContentType() returns null then "application/octet-stream" is returned.

指定者:
接口 DataSource 中的 getContentType

getName

public String getName()
Returns the file name of the URL object.

指定者:
接口 DataSource 中的 getName
返回:
the name as returned by URL.getFile()

getInputStream

public InputStream getInputStream()
                           throws IOException
Returns an InputStream obtained from the URL.

指定者:
接口 DataSource 中的 getInputStream
返回:
the InputStream from URL.openStream()
抛出:
IOException

getOutputStream

public OutputStream getOutputStream()
                             throws IOException
Returns an OutputStream obtained from the URL.

指定者:
接口 DataSource 中的 getOutputStream
抛出:
IOException

getURL

public URL getURL()
Returns the URL of the data source.



Copyright © 2013. All Rights Reserved.