test_class.declarator: log = LoggerFactory.getLogger(PdfThumbnailProviderTest.class)
test_class.modifier: private static final
test_class.original_string: private static final Logger log = LoggerFactory.getLogger(PdfThumbnailProviderTest.class);
test_class.type: Logger
test_class.var_name: log
test_class.declarator: context = new SlingContext()
test_class.modifier: @Rule
      public final
test_class.original_string: @Rule
      public final SlingContext context = new SlingContext();
test_class.type: SlingContext
test_class.var_name: context
test_class.declarator: imageFile
test_class.modifier: private
test_class.original_string: private Resource imageFile;
test_class.type: Resource
test_class.var_name: imageFile
test_class.declarator: pdfFile
test_class.modifier: private
test_class.original_string: private Resource pdfFile;
test_class.type: Resource
test_class.var_name: pdfFile
test_class.file: transformer/src/test/java/org/apache/sling/cms/transformer/internal/PdfThumbnailProviderTest.java
test_class.identifier: PdfThumbnailProviderTest
test_case.body: @Test
      public void testPDFThumbnailProvider() throws IOException {
          log.info("testPDFThumbnailProvider");
          PdfThumbnailProvider ptp = new PdfThumbnailProvider();
          assertNotNull(ptp.getThumbnail(pdfFile));
      }
test_case.class_method_signature: PdfThumbnailProviderTest.testPDFThumbnailProvider()
test_case.full_signature: @Test public void testPDFThumbnailProvider()
test_case.identifier: testPDFThumbnailProvider
test_case.invocations: info assertNotNull getThumbnail
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testPDFThumbnailProvider()
focal_class.file: transformer/src/main/java/org/apache/sling/cms/transformer/internal/PdfThumbnailProvider.java
focal_class.identifier: PdfThumbnailProvider
focal_class.interfaces: implements ThumbnailProvider
focal_class.class_method_signature: PdfThumbnailProvider.applies(Resource resource)
focal_class.full_signature: @Override public boolean applies(Resource resource)
focal_class.identifier: applies
focal_class.modifiers: @Override public
focal_class.parameters: (Resource resource)
focal_class.return: boolean
focal_class.signature: boolean applies(Resource resource)
focal_class.class_method_signature: PdfThumbnailProvider.getThumbnail(Resource resource)
focal_class.full_signature: @Override public InputStream getThumbnail(Resource resource)
focal_class.identifier: getThumbnail
focal_class.modifiers: @Override public
focal_class.parameters: (Resource resource)
focal_class.return: InputStream
focal_class.signature: InputStream getThumbnail(Resource resource)
focal_method.body: @Override
      public InputStream getThumbnail(Resource resource) throws IOException {
          try (PDDocument document = PDDocument.load(resource.adaptTo(InputStream.class))) {
              PDFRenderer pdfRenderer = new PDFRenderer(document);
              BufferedImage bim = pdfRenderer.renderImageWithDPI(0, 300, ImageType.RGB);
              ByteArrayOutputStream os = new ByteArrayOutputStream();
              ImageIO.write(bim, "jpeg", os);
              return new ByteArrayInputStream(os.toByteArray());
          }
      }
focal_method.class_method_signature: PdfThumbnailProvider.getThumbnail(Resource resource)
focal_method.full_signature: @Override public InputStream getThumbnail(Resource resource)
focal_method.identifier: getThumbnail
focal_method.invocations: load adaptTo renderImageWithDPI write toByteArray
focal_method.modifiers: @Override public
focal_method.parameters: (Resource resource)
focal_method.return: InputStream
focal_method.signature: InputStream getThumbnail(Resource resource)