Class SitePreviewTools


  • public class SitePreviewTools
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String generatePreview​(java.lang.String url, java.lang.String cutyCaptExecutable, java.lang.String workingDir, int width, long timeout)  
      static org.zkoss.zul.Image generatePreviewImage​(java.lang.String url, java.lang.String cutyCaptExecutable, java.lang.String workingDir, int width, long timeout)
      Generates a screenshot from a website
      static java.awt.image.BufferedImage scaleToWidth​(java.awt.image.BufferedImage image, int width)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SitePreviewTools

        public SitePreviewTools()
    • Method Detail

      • generatePreviewImage

        public static org.zkoss.zul.Image generatePreviewImage​(java.lang.String url,
                                                               java.lang.String cutyCaptExecutable,
                                                               java.lang.String workingDir,
                                                               int width,
                                                               long timeout)
        Generates a screenshot from a website
        Parameters:
        url - the website's url
        cutyCaptExecutable - the command line executable which is used to generate the preview, must be invokable in the syntax "captureExecutable URL OUTPUTFILE"
        workingDir - the working directory for the temporary files
        timeout - the amount of milliseconds to wait for the external process
        Returns:
        the image, or null, if loading failed
      • generatePreview

        public static java.lang.String generatePreview​(java.lang.String url,
                                                       java.lang.String cutyCaptExecutable,
                                                       java.lang.String workingDir,
                                                       int width,
                                                       long timeout)
      • scaleToWidth

        public static java.awt.image.BufferedImage scaleToWidth​(java.awt.image.BufferedImage image,
                                                                int width)