|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.cometway.props.Props
com.cometway.ak.Agent
com.cometway.ak.ScheduledAgent
com.cometway.io.FileReaper
public class FileReaper
This agent uses a Scheduler to periodically wakeup when it scans the directory specified by scan_dir and deletes all files older than file_lifespan_ms (specified in milliseconds). Optionally, the property filename_suffix can be specified to delete only files with a specific extension (such as .txt). Properties used: schedule, scan_dir (./), file_lifespan_ms (300000), filename_suffix (optional).
| Nested Class Summary | |
|---|---|
class |
FileReaper.FilenameFilterImpl
|
| Field Summary | |
|---|---|
protected FileReaper.FilenameFilterImpl |
filenameFilter
|
protected static java.text.SimpleDateFormat |
SDF
|
| Fields inherited from class com.cometway.ak.ScheduledAgent |
|---|
schedule |
| Fields inherited from class com.cometway.ak.Agent |
|---|
agent_id, agentController, CREATING_STATE, debugReporter, DESTROYED_STATE, DESTROYING_STATE, errorReporter, FAILED_STATE, printlnReporter, props, RUNNING_STATE, STARTING_STATE, STOPPED_STATE, STOPPING_STATE, warningReporter |
| Constructor Summary | |
|---|---|
FileReaper()
|
|
| Method Summary | |
|---|---|
void |
initProps()
Override this method to provide default properties for subclasses. |
void |
wakeup()
Override this method to handle schedule wakeup notifications. |
| Methods inherited from class com.cometway.ak.ScheduledAgent |
|---|
addScheduleChangeListener, getSchedule, removeScheduleChangeListener, schedule, start, stop, unschedule |
| Methods inherited from class com.cometway.ak.Agent |
|---|
currentStateEquals, debug, destroy, error, error, getAgentController, getDateTimeStr, getProps, getServiceImpl, getStateMachineModel, println, register, registerService, setAgentController, setProps, toString, unregister, unregisterService, warning, warning |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static java.text.SimpleDateFormat SDF
protected FileReaper.FilenameFilterImpl filenameFilter
| Constructor Detail |
|---|
public FileReaper()
| Method Detail |
|---|
public void initProps()
ScheduledAgent
initProps in interface AgentInterfaceinitProps in class ScheduledAgentpublic void wakeup()
ScheduledAgent
wakeup in interface ISchedulablewakeup in class ScheduledAgent
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||