test_class.declarator: log = LoggerFactory.getLogger(TikaFallbackProviderTest.class)
test_class.modifier: private static final
test_class.original_string: private static final Logger log = LoggerFactory.getLogger(TikaFallbackProviderTest.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: largeFile
test_class.modifier: private
test_class.original_string: private Resource largeFile;
test_class.type: Resource
test_class.var_name: largeFile
test_class.file: transformer/src/test/java/org/apache/sling/cms/transformer/internal/TikaFallbackProviderTest.java
test_class.identifier: TikaFallbackProviderTest
test_case.body: @Test
      public void testLargeFile() throws IOException {
          log.info("testLargeFile");
          TikaFallbackProvider tfp = new TikaFallbackProvider();
          assertNotNull(tfp.getThumbnail(largeFile));
      }
test_case.class_method_signature: TikaFallbackProviderTest.testLargeFile()
test_case.full_signature: @Test public void testLargeFile()
test_case.identifier: testLargeFile
test_case.invocations: info assertNotNull getThumbnail
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testLargeFile()
focal_class.declarator: log = LoggerFactory.getLogger(TikaFallbackProvider.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(TikaFallbackProvider.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.file: transformer/src/main/java/org/apache/sling/cms/transformer/internal/TikaFallbackProvider.java
focal_class.identifier: TikaFallbackProvider
focal_class.interfaces: implements ThumbnailProvider
focal_class.class_method_signature: TikaFallbackProvider.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: TikaFallbackProvider.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_class.class_method_signature: TikaFallbackProvider.extractContents(Resource resource)
focal_class.full_signature: private String extractContents(Resource resource)
focal_class.identifier: extractContents
focal_class.modifiers: private
focal_class.parameters: (Resource resource)
focal_class.return: String
focal_class.signature: String extractContents(Resource resource)
focal_method.body: @Override
      public InputStream getThumbnail(Resource resource) throws IOException {
  
          log.info("Extracting content thumbnail from {}", resource.getPath());
          try {
  
              log.debug("Extracting file contents");
              String contents = extractContents(resource);
  
              log.debug("Creating thumbnail of file contents");
              int width = 500;
              int height = 500;
              BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
              Graphics graphics = image.createGraphics();
              JEditorPane jep = new JEditorPane("text/html", contents);
              jep.setSize(width, height);
              jep.print(graphics);
  
              ByteArrayOutputStream baos = new ByteArrayOutputStream();
              ImageIO.write(image, OutputFileFormat.PNG.toString(), baos);
              return new ByteArrayInputStream(baos.toByteArray());
          } catch (SAXException | TikaException e) {
              throw new IOException("Failed to generate thumbnail from " + resource.getPath(), e);
          }
      }
focal_method.class_method_signature: TikaFallbackProvider.getThumbnail(Resource resource)
focal_method.full_signature: @Override public InputStream getThumbnail(Resource resource)
focal_method.identifier: getThumbnail
focal_method.invocations: info getPath debug extractContents debug createGraphics setSize print write toString toByteArray getPath
focal_method.modifiers: @Override public
focal_method.parameters: (Resource resource)
focal_method.return: InputStream
focal_method.signature: InputStream getThumbnail(Resource resource)