|
|||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| FileShowAllConsoleAlerter.java | - | 0% | 0% | 0% |
|
||||||||||||||
| 1 | /* $Id: FileShowAllConsoleAlerter.java,v 1.1 2004/04/27 10:57:51 johndavidtaylor Exp $ | |
| 2 | * Created on Mar 2, 2004 by John Taylor jdt@roe.ac.uk . | |
| 3 | * | |
| 4 | * Copyright (C) AstroGrid. All rights reserved. | |
| 5 | ||
| 6 | */ | |
| 7 | ||
| 8 | package org.abraracourcix.alipes.alerters; | |
| 9 | ||
| 10 | import java.io.File; | |
| 11 | ||
| 12 | import org.abraracourcix.alipes.listeners.logging.ConsoleListener; | |
| 13 | import org.abraracourcix.alipes.monitors.file.FileStateMonitor; | |
| 14 | import org.abraracourcix.alipes.monitors.file.FileStateMonitorFactory; | |
| 15 | ||
| 16 | /** | |
| 17 | * very simple glue to demonstrate a FileStateMonitor | |
| 18 | * @author jdt | |
| 19 | * | |
| 20 | */ | |
| 21 | public final class FileShowAllConsoleAlerter { | |
| 22 | /** | |
| 23 | * Hide | |
| 24 | * Constructor | |
| 25 | * | |
| 26 | */ | |
| 27 | 0 | private FileShowAllConsoleAlerter() {} |
| 28 | ||
| 29 | /** | |
| 30 | * Fire it up | |
| 31 | * @param args ignored | |
| 32 | * @throws InterruptedException whoops | |
| 33 | */ | |
| 34 | 0 | public static void main(final String[] args) throws InterruptedException { |
| 35 | 0 | System.out.println("Ctrl-C when you're bored"); |
| 36 | 0 | ConsoleListener listener = new ConsoleListener(); |
| 37 | 0 | FileStateMonitor mon = FileStateMonitorFactory.getFileStateMonitor(new File("."), ".*\\.txt", listener, 10); |
| 38 | 0 | mon.addFile(new File("test.txt")); |
| 39 | 0 | mon.setStaleInterval(60); |
| 40 | 0 | Thread.sleep(60860*1000); |
| 41 | } | |
| 42 | } | |
| 43 | ||
| 44 | ||
| 45 | /* | |
| 46 | *$Log: FileShowAllConsoleAlerter.java,v $ | |
| 47 | *Revision 1.1 2004/04/27 10:57:51 johndavidtaylor | |
| 48 | *changed package name | |
| 49 | * | |
| 50 | *Revision 1.1 2004/03/17 21:16:51 johndavidtaylor | |
| 51 | *Copied across from incubation in beanpeeler | |
| 52 | * | |
| 53 | *Revision 1.5 2004/03/14 18:49:14 johndavidtaylor | |
| 54 | *corrected comments | |
| 55 | * | |
| 56 | *Revision 1.4 2004/03/11 15:46:34 johndavidtaylor | |
| 57 | *Applied coding standards | |
| 58 | * | |
| 59 | *Revision 1.3 2004/03/09 22:29:32 johndavidtaylor | |
| 60 | *Added stuff for file wildcards/regexps | |
| 61 | * | |
| 62 | *Revision 1.2 2004/03/08 20:16:44 johndavidtaylor | |
| 63 | *refactored to new package name | |
| 64 | * | |
| 65 | *Revision 1.1 2004/03/08 19:58:24 johndavidtaylor | |
| 66 | *Initial commit -transfer from previous repository | |
| 67 | * | |
| 68 | *Revision 1.2 2004/03/04 17:50:55 jdt | |
| 69 | **** empty log message *** | |
| 70 | * | |
| 71 | *Revision 1.1 2004/03/02 23:04:37 jdt | |
| 72 | *new | |
| 73 | * | |
| 74 | */ |
|
||||||||||