@Test(expected = TaskIOException.class) public void openDocumentTwice_streamSource_not_possible() throws TaskIOException, IOException { PdfStreamSource source = PdfStreamSource.newInstanceNoPassword( getClass().getClassLoader().getResourceAsStream("pdf/test_file.pdf"), "my source"); try(PDDocumentHandler handler = new DefaultPdfSourceOpener().open(source)) { assertNotNull(handler.getUnderlyingPDDocument()); } try(PDDocumentHandler handler = new DefaultPdfSourceOpener().open(source)) { fail("Exception was expected"); } }
@Override public PDDocumentHandler open(PdfURLSource source) throws TaskIOException { return openGeneric(source); }
DefaultPdfSourceOpener implements PdfSourceOpener<PDDocumentHandler> { @Override public PDDocumentHandler open(PdfURLSource source) throws TaskIOException { return openGeneric(source); } }
DefaultPdfSourceOpener implements PdfSourceOpener<PDDocumentHandler> { @Override public PDDocumentHandler open(PdfURLSource source) throws TaskIOException { return openGeneric(source); }  }
DefaultPdfSourceOpener implements PdfSourceOpener<PDDocumentHandler> { @Override public PDDocumentHandler open(PdfURLSource source) throws TaskIOException { return openGeneric(source); }  @Override PDDocumentHandler open(PdfURLSource source); @Override PDDocumentHandler open(PdfFileSource source); @Override PDDocumentHandler open(PdfStreamSource source); }
DefaultPdfSourceOpener implements PdfSourceOpener<PDDocumentHandler> { @Override public PDDocumentHandler open(PdfURLSource source) throws TaskIOException { return openGeneric(source); }  @Override PDDocumentHandler open(PdfURLSource source); @Override PDDocumentHandler open(PdfFileSource source); @Override PDDocumentHandler open(PdfStreamSource source);  }