Class BinaryDataSource
- java.lang.Object
-
- net.webpdf.wsclient.session.soap.documents.datasource.BinaryDataSource
-
- All Implemented Interfaces:
jakarta.activation.DataSource,AutoCloseable
public class BinaryDataSource extends Object implements jakarta.activation.DataSource, AutoCloseable
An instance ofBinaryDataSourceprepares the data of a given resource for further processing and usage by a webPDF webservice call.
-
-
Constructor Summary
Constructors Constructor Description BinaryDataSource(@NotNull InputStream inputStream)Prepares the givenInputStreamfor further processing.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Deletes the underlying tempFile.@NotNull StringgetContentType()Returns the MIME-type of the contained resource.@NotNull InputStreamgetInputStream()Returns theInputStreamcontaining the resource data represented by this data source.@NotNull StringgetName()Returns the name of the contained resource.@NotNull OutputStreamgetOutputStream()Writing to the managed resource is unsupported.
-
-
-
Constructor Detail
-
BinaryDataSource
public BinaryDataSource(@NotNull @NotNull InputStream inputStream) throws IOExceptionPrepares the givenInputStreamfor further processing.- Parameters:
inputStream- anInputStreamcontaining the resource.- Throws:
IOException
-
-
Method Detail
-
getInputStream
@NotNull public @NotNull InputStream getInputStream() throws IOException
Returns theInputStreamcontaining the resource data represented by this data source.- Specified by:
getInputStreamin interfacejakarta.activation.DataSource- Returns:
- The
InputStreamcontaining the resource data. - Throws:
IOException- Shall be thrown, should the tempFilenot be readable.
-
getOutputStream
@NotNull public @NotNull OutputStream getOutputStream() throws IOException
Writing to the managed resource is unsupported.- Specified by:
getOutputStreamin interfacejakarta.activation.DataSource- Returns:
- an
OutputStream - Throws:
IOException- Shall be thrown, should the tempFilenot be writable.
-
getContentType
@NotNull public @NotNull String getContentType()
Returns the MIME-type of the contained resource.- Specified by:
getContentTypein interfacejakarta.activation.DataSource- Returns:
- The MIME-type of the contained resource.
-
getName
@NotNull public @NotNull String getName()
Returns the name of the contained resource.- Specified by:
getNamein interfacejakarta.activation.DataSource- Returns:
- The name of the contained resource.
-
close
public void close() throws ResultExceptionDeletes the underlying tempFile.- Specified by:
closein interfaceAutoCloseable- Throws:
ResultException- Shall be thrown, when deleting the temp file failed.
-
-