From: bruce m. <tr...@us...> - 2004-07-25 17:25:49
|
Update of /cvsroot/babeldoc/babeldoc/modules/scanner/src/com/babeldoc/scanner/worker In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16769/modules/scanner/src/com/babeldoc/scanner/worker Modified Files: DirectoryScanner.java Added Files: package.html Log Message: javadoc and formatting here. Index: DirectoryScanner.java =================================================================== RCS file: /cvsroot/babeldoc/babeldoc/modules/scanner/src/com/babeldoc/scanner/worker/DirectoryScanner.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** DirectoryScanner.java 24 Jul 2004 00:18:52 -0000 1.27 --- DirectoryScanner.java 25 Jul 2004 17:25:39 -0000 1.28 *************** *** 100,104 **** public static final String FILTER_FILENAME = "filter"; public static final String MINIMUM_FILE_AGE = "minimumFileAge"; ! private LogService log = LogService.getInstance(this.getClass().getName()); --- 100,104 ---- public static final String FILTER_FILENAME = "filter"; public static final String MINIMUM_FILE_AGE = "minimumFileAge"; ! private LogService log = LogService.getInstance(this.getClass().getName()); *************** *** 173,177 **** getDoneDirectory()), null); ! } } else { getLog().logInfo("Done directory not specified. All processed file will be deleted!!!"); --- 173,177 ---- getDoneDirectory()), null); ! } } else { getLog().logInfo("Done directory not specified. All processed file will be deleted!!!"); *************** *** 217,221 **** return; } ! String path = file.getAbsolutePath(); --- 217,221 ---- return; } ! String path = file.getAbsolutePath(); *************** *** 319,329 **** baos.toByteArray(), new NameValuePair[] { ! new NameValuePair( ! SCAN_MIMETYPE_KEY, PipelineDocument.getMimeTypeForFile(file.getName())), new NameValuePair(SCAN_DATE_KEY, Long.toString(modified)), new NameValuePair(SCAN_PATH_KEY, file.getCanonicalPath()), new NameValuePair(FILE_NAME_KEY, file.getName()), ! new NameValuePair(DONE_DIR_KEY, getDoneDirectory())}); } finally { fis.close(); --- 319,328 ---- baos.toByteArray(), new NameValuePair[] { ! new NameValuePair(SCAN_MIMETYPE_KEY, PipelineDocument.getMimeTypeForFile(file.getName())), new NameValuePair(SCAN_DATE_KEY, Long.toString(modified)), new NameValuePair(SCAN_PATH_KEY, file.getCanonicalPath()), new NameValuePair(FILE_NAME_KEY, file.getName()), ! new NameValuePair(DONE_DIR_KEY, getDoneDirectory())}); } finally { fis.close(); *************** *** 337,341 **** * of the file and a filename filter, both optional and by * default all permissive. ! * * @param file The file to be checked against configuration * @return true If the file should be processed at this time --- 336,340 ---- * of the file and a filename filter, both optional and by * default all permissive. ! * * @param file The file to be checked against configuration * @return true If the file should be processed at this time *************** *** 356,363 **** return false; } ! /** * Get age of file in ms. ! * * @param file The file to get the age of. * @return long The age of the file in ms. --- 355,362 ---- return false; } ! /** * Get age of file in ms. ! * * @param file The file to get the age of. * @return long The age of the file in ms. *************** *** 391,399 **** this.includeSubDirs = includeSubDirs; } ! public int getMinimumFileAge() { return minimumFileAge; } ! public void setMinimumFileAge(int minimumFileAge) { if(minimumFileAge < 0) minimumFileAge = 0; --- 390,398 ---- this.includeSubDirs = includeSubDirs; } ! public int getMinimumFileAge() { return minimumFileAge; } ! public void setMinimumFileAge(int minimumFileAge) { if(minimumFileAge < 0) minimumFileAge = 0; --- NEW FILE: package.html --- <body> <h2>Introduction</h2> Scanner workers are the classes that actually do the application specific scanning - ie, finding documents and enqueuing them into <strong>Babeldoc</strong>. <h2>How-to</h2> <p>Each scanner worker needs to extend the class <code>ScannerWorker</code>. This class has three abstract methods that need to be provided: <ul> <li><code>initilize</code> - gets called prior to scanning and is intended for scanners that need to grab resouces or otherwise set up their environment</li> <li><code>relinquishResources</code> - gets called after the scanner has completed. It is intended to release any resources that have been grabbed by this scanner worker.</li> <li><code>doScan</code> - this method is called based on the configured scheduling. Its purpose is to look for documents, process them and submit the document to the pipeline process</li> </ul></p> <p>There is an additional task that must be performed - the <code>ScannerWorker</code> constructor must be called with a class that extends <code>ScannerWorkerInfo</code>. This config info class supplies all the configuration options that is expected by this class.</p> </body> |