Class PathDataSource

  • All Implemented Interfaces:
    jakarta.activation.DataSource

    public class PathDataSource
    extends Object
    implements jakarta.activation.DataSource
    An instance of PathDataSource prepares the data of a given resource for further processing and usage by a webPDF webservice call.
    • Constructor Detail

      • PathDataSource

        public PathDataSource​(@NotNull
                              @NotNull Path path)
                       throws IOException
        Prepares the given Path for further processing.
        Parameters:
        path - an Path containing the resource.
        Throws:
        IOException
    • Method Detail

      • getInputStream

        @NotNull
        public @NotNull InputStream getInputStream()
                                            throws IOException
        Returns the InputStream containing the resource at the selected Path.
        Specified by:
        getInputStream in interface jakarta.activation.DataSource
        Returns:
        The InputStream containing the resource data.
        Throws:
        IOException - Shall be thrown, should the Path not be readable.
      • getContentType

        @NotNull
        public @NotNull String getContentType()
        Returns the MIME-type of the contained resource.
        Specified by:
        getContentType in interface jakarta.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:
        getName in interface jakarta.activation.DataSource
        Returns:
        The name of the contained resource.