KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > codehaus > loom > components > util > monitor > MockDirectoryChangeListener


1 /*
2  * Copyright (C) The Loom Group. All rights reserved.
3  *
4  * This software is published under the terms of the Loom
5  * Software License version 1.1, a copy of which has been included
6  * with this distribution in the LICENSE.txt file.
7  */

8 package org.codehaus.loom.components.util.monitor;
9
10 import java.util.Collections JavaDoc;
11 import java.util.Set JavaDoc;
12
13 /**
14  * DirectoryChangeListener used for storing a single change.
15  *
16  * @author Johan Sjoberg
17  * @version $Revision: 1.2 $
18  */

19 public class MockDirectoryChangeListener
20     implements DirectoryChangeListener
21 {
22     /**
23      * The recorded change type
24      */

25     protected int m_changeType = 0;
26
27     /**
28      * The recorded set of files
29      */

30     protected Set JavaDoc m_fileSet = Collections.EMPTY_SET;
31
32     /**
33      * Record a change.
34      */

35     public void directoryChange( final int type, final Set JavaDoc fileSet )
36     {
37         m_changeType = type;
38         m_fileSet = fileSet;
39     }
40
41     public void unableToListContents()
42     {
43         throw new RuntimeException JavaDoc( "Expected to be able to view directory contents" );
44     }
45 }
Popular Tags