org.jppf.utils
Class ThumbnailGenerator

java.lang.Object
  extended by 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
static class ThumbnailGenerator.ImageFileFilter
          File filter that only accepts GIF, JPG and PNG files.
 
Constructor Summary
ThumbnailGenerator(String path, int width, int height)
          Initialize this thumbnail generator with the psecified root dir, width and height.
ThumbnailGenerator(String path, int width, int height, int rowLength)
          Initialize this thumbnail generator with the psecified 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 psecified root dir, width, height and default number of thumbnails per row.
 
Method Summary
 void generate()
          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 Detail

ThumbnailGenerator

public ThumbnailGenerator(String path,
                          int width,
                          int height)
Initialize this thumbnail generator with the psecified 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 psecified 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 psecified 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 Detail

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.


Copyright © 2005-2010 JPPF Team.