Class ThumbnailGenerator

java.lang.Object
org.jppf.utils.ThumbnailGenerator

public class ThumbnailGenerator extends Object
Instances of this class generate thumbnails from a set of images stored in a file system folder.
Author:
Laurent Cohen
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
    static class 
    File filter that only accepts files with specified extensions.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ThumbnailGenerator(String path, int width, int height)
    Initialize this thumbnail generator with the specified root dir, width and height.
    ThumbnailGenerator(String path, int width, int height, int rowLength)
    Initialize this thumbnail generator with the specified root dir, width, height and default number of thumbnails per row.
    ThumbnailGenerator(String path, int width, int height, String includePath, int rowLength)
    Initialize this thumbnail generator with the specified root dir, width, height and default number of thumbnails per row.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Generate all thumbnails.
    static void
    main(String... args)
    Perform the thumbnail generation.

    Methods inherited from class java.lang.Object

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

    • ThumbnailGenerator

      public ThumbnailGenerator(String path, int width, int height)
      Initialize this thumbnail generator with the specified root dir, width and height.
      Parameters:
      path - the path to the directory in which to find the images.
      width - the width of the generated thumbnails.
      height - the height of the generated thumbnails.
    • ThumbnailGenerator

      public ThumbnailGenerator(String path, int width, int height, int rowLength)
      Initialize this thumbnail generator with the specified root dir, width, height and default number of thumbnails per row.
      Parameters:
      path - the path to the directory in which to find the images.
      width - the width of the generated thumbnails.
      height - the height of the generated thumbnails.
      rowLength - the number of thumbnails per row.
    • ThumbnailGenerator

      public ThumbnailGenerator(String path, int width, int height, String includePath, int rowLength)
      Initialize this thumbnail generator with the specified root dir, width, height and default number of thumbnails per row.
      Parameters:
      path - the path to the directory in which to find the images.
      width - the width of the generated thumbnails.
      height - the height of the generated thumbnails.
      includePath - the generated file to include in the screenshots php page.
      rowLength - the number of thumbnails per row..
  • Method Details

    • generate

      public void generate() throws Exception
      Generate all thumbnails.
      Throws:
      Exception - if an IO error is raised.
    • main

      public static void main(String... args)
      Perform the thumbnail generation.
      Parameters:
      args - contains in that order: root path, thumbnail width, thumbnail height.