|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.photoviewer.server.PhotoGenerator
Generate thumbnails and screen size pictures from a master directory. A parallel directory of thumbnail and screen size pictures will be generated and kept synchronized to a directory containing the "master" images.
Field Summary | |
static java.lang.String |
COPYRIGHT
|
static java.lang.String |
DEST_DIR
|
static java.lang.String |
HTML_POSTFIX
|
static java.lang.String |
INDEX_PREFIX
|
static java.lang.String |
JPEG_LEVEL
|
static java.lang.String |
JPEG_POSTFIX
|
static java.lang.String |
NORMAL_DIM
|
static java.lang.String |
SRC_DIR
|
static java.lang.String |
THUMBNAIL_DIM
|
static java.lang.String |
TREE_PREFIX
|
static java.lang.String |
VERSION
|
Constructor Summary | |
PhotoGenerator(java.lang.String[] args)
/** Instantiate the generator dumping the output to the console. |
|
PhotoGenerator(java.lang.String[] args,
java.io.PrintWriter console)
Instantiate the generator dumping the output to a PrintWriter. |
Method Summary | |
boolean |
accept(java.io.File f)
Following the FileFilter interface, do we accept this file (we are looking for JPEG files). |
boolean |
accept(java.io.File f,
java.lang.String ending)
Question: does the File end with 'ending'. |
protected void |
buildPage(Path currentPath)
Build the thumbnails page. |
protected void |
buildPathTree(Path currentPath)
Recursively search through the source directories building our com.photoviewer.server.Path tree. |
protected void |
checkProperties()
Check to see that the required properties exist. |
protected java.io.File[] |
createPictures(Path path,
java.io.File srcPic)
Create the display/normal and thumbnail versions of the source picture (if necessary) |
protected void |
createResizers()
Create a normal and thumbnail resizer based off of the current properties. |
protected void |
deleteOldDest(Path currentPath)
Delete all HTML files (since they are regenerated each time) and any normal and thumbnail pictures that does not have a corresponding picture in the source directory. |
static void |
ExamplePropertiesFile()
|
protected java.lang.String |
fileSize(long sz)
|
protected java.lang.String |
getDestDir(Path currentPath)
|
protected float |
getFloat(java.lang.String key)
|
protected java.lang.String |
getGlobalStr(java.lang.String key)
|
protected int |
getInt(java.lang.String key)
|
protected java.lang.String |
getLocalStr(java.lang.String key)
|
protected java.lang.String |
getSrcDir(Path currentPath)
|
protected void |
handlePath(Path currentPath)
Do the work for a particular path. |
static void |
main(java.lang.String[] args)
|
protected java.lang.String |
pad(int i)
|
protected void |
parseArgs(java.lang.String[] args)
|
protected void |
print(int i)
|
protected void |
print(java.lang.Object o)
|
protected void |
printElapsedtime(long diff)
|
protected void |
println(java.lang.Object o)
|
protected void |
println(java.lang.String s)
|
protected void |
readDefaultProperties(java.lang.String fn)
Read the initial properties and store them in the default and current properties objects. |
protected java.util.Properties |
readLocalDescriptions(java.io.File src)
If a 'descript.ion' file exists, read it to determine individual picture comments. |
protected java.util.Properties |
readLocalProperties(java.io.File src)
|
protected java.lang.String |
readTextFile(java.io.File f)
|
protected java.lang.String |
rootNameFor(java.io.File f)
Given the name of a destination JPG, try to determine the name of source file that created it (removing the thumbnail and normal prefixes). |
protected java.lang.String |
rootNameFor(java.io.File f,
java.lang.String prefix)
|
protected boolean |
shouldCreateNormal(Path path,
java.io.File src,
java.io.File dest)
|
protected boolean |
shouldCreateThumbnail(java.io.File src,
java.io.File dest)
|
protected void |
start()
|
protected void |
startAtRoot()
|
protected java.util.Vector |
subdirsFor(java.io.File dir)
|
protected java.lang.String |
wfn(java.lang.String fn)
WFN = WebFileName. |
protected java.lang.String |
xfn(java.lang.String fn)
Fix descriptions for listing in XML files. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String VERSION
public static final java.lang.String COPYRIGHT
public static final java.lang.String SRC_DIR
public static final java.lang.String DEST_DIR
public static final java.lang.String THUMBNAIL_DIM
public static final java.lang.String NORMAL_DIM
public static final java.lang.String JPEG_LEVEL
public static final java.lang.String INDEX_PREFIX
public static final java.lang.String TREE_PREFIX
public static final java.lang.String HTML_POSTFIX
public static final java.lang.String JPEG_POSTFIX
Constructor Detail |
public PhotoGenerator(java.lang.String[] args)
public PhotoGenerator(java.lang.String[] args, java.io.PrintWriter console)
Method Detail |
public boolean accept(java.io.File f)
accept
in interface java.io.FileFilter
public boolean accept(java.io.File f, java.lang.String ending)
protected void buildPage(Path currentPath) throws java.lang.Exception
java.lang.Exception
protected void buildPathTree(Path currentPath) throws java.lang.Exception
java.lang.Exception
protected void checkProperties()
protected java.io.File[] createPictures(Path path, java.io.File srcPic) throws java.lang.Exception
path
- Path object representing the current pathsrcPic
- File representing the current master picture to be processed
java.lang.Exception
protected void createResizers()
protected void deleteOldDest(Path currentPath) throws java.lang.Exception
java.lang.Exception
public static void ExamplePropertiesFile()
protected java.lang.String fileSize(long sz)
protected java.lang.String getDestDir(Path currentPath)
protected float getFloat(java.lang.String key)
protected java.lang.String getGlobalStr(java.lang.String key)
protected int getInt(java.lang.String key)
protected java.lang.String getLocalStr(java.lang.String key)
protected java.lang.String getSrcDir(Path currentPath)
protected void handlePath(Path currentPath) throws java.lang.Exception
java.lang.Exception
public static void main(java.lang.String[] args)
protected java.lang.String pad(int i)
protected void parseArgs(java.lang.String[] args)
protected void print(int i)
protected void print(java.lang.Object o)
protected void printElapsedtime(long diff)
protected void println(java.lang.Object o)
protected void println(java.lang.String s)
protected void readDefaultProperties(java.lang.String fn)
protected java.util.Properties readLocalDescriptions(java.io.File src)
protected java.util.Properties readLocalProperties(java.io.File src)
protected java.lang.String readTextFile(java.io.File f) throws java.lang.Exception
java.lang.Exception
protected java.lang.String rootNameFor(java.io.File f)
protected java.lang.String rootNameFor(java.io.File f, java.lang.String prefix)
protected boolean shouldCreateNormal(Path path, java.io.File src, java.io.File dest) throws java.lang.Exception
java.lang.Exception
protected boolean shouldCreateThumbnail(java.io.File src, java.io.File dest)
protected void start()
protected void startAtRoot() throws java.lang.Exception
java.lang.Exception
protected java.util.Vector subdirsFor(java.io.File dir)
protected java.lang.String wfn(java.lang.String fn)
protected java.lang.String xfn(java.lang.String fn)
fn
- String to fix
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |