public class StringDataSource extends Object implements DataSource
| Constructor and Description |
|---|
StringDataSource(byte[] bytes,
String contentType)
Create a StringDataSource using the provided byte array.
|
StringDataSource(InputStream stream,
String contentType)
Create a StringDataSource using the provided InputStream.
|
StringDataSource(String content,
String contentType)
Create a StringDataSource with the provided String content and
contentType.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getContentType() |
InputStream |
getInputStream()
Get an InputStream containing the data for this DataSource.
|
String |
getName() |
OutputStream |
getOutputStream()
Get an OutputStream for this DataSource.
|
String |
getString()
Get the content of this DataSource as a String.
|
void |
setName(String name) |
public StringDataSource(String content, String contentType)
content - contentType - public StringDataSource(byte[] bytes,
String contentType)
bytes - contentType - public StringDataSource(InputStream stream, String contentType)
stream - contentType - public String getContentType()
getContentType in interface DataSourcepublic InputStream getInputStream() throws IOException
getInputStream in interface DataSourceIOExceptionpublic String getName()
getName in interface DataSourcepublic void setName(String name)
public OutputStream getOutputStream() throws IOException
getOutputStream in interface DataSourceIOExceptionpublic String getString()
Copyright © 2009,2014 Oracle and/or its affiliates. All rights reserved.