test_class.declarator: log = LoggerFactory.getLogger(SlideShowThumbnailProviderTest.class)
test_class.modifier: private static final
test_class.original_string: private static final Logger log = LoggerFactory.getLogger(SlideShowThumbnailProviderTest.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: docxFile
test_class.modifier: private
test_class.original_string: private Resource docxFile;
test_class.type: Resource
test_class.var_name: docxFile
test_class.declarator: pptFile
test_class.modifier: private
test_class.original_string: private Resource pptFile;
test_class.type: Resource
test_class.var_name: pptFile
test_class.declarator: pptxFile
test_class.modifier: private
test_class.original_string: private Resource pptxFile;
test_class.type: Resource
test_class.var_name: pptxFile
test_class.declarator: provider
test_class.modifier: private
test_class.original_string: private ThumbnailProvider provider;
test_class.type: ThumbnailProvider
test_class.var_name: provider
test_class.file: transformer/src/test/java/org/apache/sling/cms/transformer/internal/SlideShowThumbnailProviderTest.java
test_class.identifier: SlideShowThumbnailProviderTest
test_case.body: @Test
      public void testGetThumbnail() throws IOException {
          log.info("testGetThumbnail");
          assertNotNull(provider.getThumbnail(pptxFile));
          assertNotNull(provider.getThumbnail(pptFile));
      }
test_case.class_method_signature: SlideShowThumbnailProviderTest.testGetThumbnail()
test_case.full_signature: @Test public void testGetThumbnail()
test_case.identifier: testGetThumbnail
test_case.invocations: info assertNotNull getThumbnail assertNotNull getThumbnail
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetThumbnail()
focal_class.declarator: dclm
focal_class.modifier: @Reference
      private
focal_class.original_string: @Reference
      private DynamicClassLoaderManager dclm;
focal_class.type: DynamicClassLoaderManager
focal_class.var_name: dclm
focal_class.file: transformer/src/main/java/org/apache/sling/cms/transformer/internal/SlideShowThumbnailProvider.java
focal_class.identifier: SlideShowThumbnailProvider
focal_class.interfaces: implements ThumbnailProvider
focal_class.class_method_signature: SlideShowThumbnailProvider.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: SlideShowThumbnailProvider.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 {
          if (dclm != null) {
              Thread.currentThread().setContextClassLoader(dclm.getDynamicClassLoader());
          }
  
          SlideShow<?, ?> ppt = null;
          MediaType mt = MediaType.parse(resource.adaptTo(File.class).getContentType());
          try (ByteArrayOutputStream baos = new ByteArrayOutputStream();
                  InputStream is = resource.adaptTo(InputStream.class)) {
              if (mt.is(MediaType.MICROSOFT_POWERPOINT)) {
                  ppt = new HSLFSlideShow(is);
              } else {
                  ppt = new XMLSlideShow(is);
              }
              Dimension dim = ppt.getPageSize();
              List<? extends Slide<?, ?>> slides = ppt.getSlides();
  
              BufferedImage img = new BufferedImage(dim.width, dim.height, BufferedImage.TYPE_INT_RGB);
              Graphics2D graphics = img.createGraphics();
              graphics.setPaint(Color.white);
              graphics.fill(new Rectangle2D.Float(0, 0, dim.width, dim.height));
  
              if (slides != null && !slides.isEmpty()) {
                  slides.get(0).draw(graphics);
              }
  
              ImageIO.write(img, OutputFileFormat.PNG.toString(), baos);
              return new ByteArrayInputStream(baos.toByteArray());
          } finally {
              if (ppt != null) {
                  ppt.close();
              }
          }
      }
focal_method.class_method_signature: SlideShowThumbnailProvider.getThumbnail(Resource resource)
focal_method.full_signature: @Override public InputStream getThumbnail(Resource resource)
focal_method.identifier: getThumbnail
focal_method.invocations: setContextClassLoader currentThread getDynamicClassLoader parse getContentType adaptTo adaptTo is getPageSize getSlides createGraphics setPaint fill isEmpty draw get write toString toByteArray close
focal_method.modifiers: @Override public
focal_method.parameters: (Resource resource)
focal_method.return: InputStream
focal_method.signature: InputStream getThumbnail(Resource resource)