public class URLDataSource extends Object implements DataSource
URL
对象在数据源接口。urldatasource简化描述的URL在激活框架因为这类可以用来创建新的datahandlers数据处理。注:该javax.激活。javax.activation.Datahandler对象创建一个urldatasource内部,当它与一个URL构造。
DataSource
,
DataHandler
Constructor and Description |
---|
URLDataSource(URL url)
urldatasource构造函数。
|
Modifier and Type | Method and Description |
---|---|
String |
getContentType()
返回的内容类型头字段的值。
|
InputStream |
getInputStream()
从URL getInputStream方法。
|
String |
getName()
要求用于实例化对象的URL的
getFile 方法。
|
OutputStream |
getOutputStream()
从URL的getoutputstream方法。
|
URL |
getURL()
返回用于创建该数据源的URL。
|
public URLDataSource(URL url)
url
的URL被封装在这个对象。
public String getContentType()
URLConnection.getContentType
方法检索一个URLConnection对象后。注意:调用URL的OpenConnection方法这种方法的尝试。如果这种方法失败,或者如果一个内容类型不是从URLConnection回来,getcontenttype返回“application/octet-stream”为内容类型。
getContentType
接口
DataSource
public String getName()
getFile
方法。
getName
接口
DataSource
public InputStream getInputStream() throws IOException
openStream
方法。
getInputStream
接口
DataSource
IOException
public OutputStream getOutputStream() throws IOException
getOutputStream
接口
DataSource
IOException
public URL getURL()
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.