org.hd.d.pg2k.svrCore
Class ExhibitFile

java.lang.Object
  extended by org.hd.d.pg2k.svrCore.ExhibitFile

public final class ExhibitFile
extends java.lang.Object

Routines to handle the filesystem representation of an exhibit. This absorbs some functionality buried in the old ImageInfoCache classes and methods.


Field Summary
private static int _estimatedDirScanUtil
          Estimated CPU utilisation per getFilesystemBasedExhibitNames() filter operation/thread.
private static int _gFBEN_concurrencyLimit
          Limit on number of concurrent threads in getFilesystemBasedExhibitNames().
 
Constructor Summary
ExhibitFile()
           
 
Method Summary
static java.util.Set<java.lang.String> getFilesystemBasedExhibitNames(java.io.File baseDir, boolean checkFileContent)
          Collect a set of names of exhibits in the filesystem.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_gFBEN_concurrencyLimit

private static final int _gFBEN_concurrencyLimit
Limit on number of concurrent threads in getFilesystemBasedExhibitNames(). Used to limit number of filehandles we simultaneously need while still allowing decent concurrency to overcome I/O delays (will be most effective with native threads).

Values of 2--8 are usually good.

See Also:
Constant Field Values

_estimatedDirScanUtil

private static final int _estimatedDirScanUtil
Estimated CPU utilisation per getFilesystemBasedExhibitNames() filter operation/thread. This assumes that some filtering is I/O bound and some CPU bound, but is at best a guess...

ParTasks.UTILISATION_MAX is taken to represent 100% CPU-bound.

We make sure that this value is at least UTILISATION_MIN.

Constructor Detail

ExhibitFile

public ExhibitFile()
Method Detail

getFilesystemBasedExhibitNames

public static java.util.Set<java.lang.String> getFilesystemBasedExhibitNames(java.io.File baseDir,
                                                                             boolean checkFileContent)
Collect a set of names of exhibits in the filesystem. Given the base directory, this collects a set of files that appear syntactically valid as exhibit names. The result is a Set of String valid exhibit names.

For system (such ans Windows) where the directory separator is not '/' it is converted to this internally to provide the canonical name format.

These are not checked to exist or contain valid data unless checkFileContent is true though the directories encountered are always checked to be directories.

The names returned omit the base directory.

The names are collected in parallel if possible.

The returned Set is mutable and synchronized.

Files are always checked for a recognized file extension.

Parameters:
checkFileContent - if true, any putative exhibit is checked for readability and for a correct magic number

DHD Multimedia Gallery V1.50.55

Copyright (c) 1996-2008, Damon Hart-Davis. All rights reserved.