public class TestDataSource extends Object implements DataSource, Serializable
Constructor and Description |
---|
TestDataSource()
Constructs a new TestDataSource.
|
TestDataSource(String name)
Constructs a new TestDataSource.
|
TestDataSource(String name,
String contentType)
Constructs a new TestDataSource.
|
TestDataSource(String name,
String contentType,
byte[] data)
Constructs a new TestDataSource.
|
TestDataSource(String name,
String contentType,
String data)
Constructs a new TestDataSource.
|
Modifier and Type | Method and Description |
---|---|
String |
getContentType() |
byte[] |
getData()
Gets the data.
|
String |
getDataString()
Gets the data as a String.
|
InputStream |
getInputStream() |
String |
getName() |
OutputStream |
getOutputStream() |
TestDataSource |
setContentType(String contentType)
Sets the contentType.
|
TestDataSource |
setData(byte[] data)
Sets the data.
|
TestDataSource |
setDataString(String data)
Sets the data as a String.
|
TestDataSource |
setName(String name)
Sets the name.
|
public TestDataSource()
public TestDataSource(String name)
name
- the namepublic TestDataSource(String name, String contentType)
name
- the namecontentType
- the contentTypepublic TestDataSource(String name, String contentType, byte[] data)
name
- the namecontentType
- the contentTypedata
- the datapublic String getName()
getName
in interface DataSource
public TestDataSource setName(String name)
name
- the namepublic String getContentType()
getContentType
in interface DataSource
public TestDataSource setContentType(String contentType)
contentType
- the contentTypepublic byte[] getData()
public TestDataSource setData(byte[] data)
data
- the datapublic String getDataString()
public TestDataSource setDataString(String data)
data
- the data as a Stringpublic InputStream getInputStream() throws IOException
getInputStream
in interface DataSource
IOException
public OutputStream getOutputStream() throws IOException
getOutputStream
in interface DataSource
IOException
Copyright © 2013–2022 JBoss by Red Hat. All rights reserved.