KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openharmonise > vfs > event > VirtualFileEvent


1 /*
2  * The contents of this file are subject to the
3  * Mozilla Public License Version 1.1 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at http://www.mozilla.org/MPL/
6  *
7  * Software distributed under the License is distributed on an "AS IS"
8  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
9  * See the License for the specific language governing rights and
10  * limitations under the License.
11  *
12  * The Initial Developer of the Original Code is Simulacra Media Ltd.
13  * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
14  *
15  * All Rights Reserved.
16  *
17  * Contributor(s):
18  */

19 package org.openharmonise.vfs.event;
20
21 import org.openharmonise.vfs.*;
22
23 /**
24  * Wrapper for events from virtual files.
25  *
26  * @author Matthew Large
27  * @version $Revision: 1.1 $
28  */

29 public class VirtualFileEvent {
30
31     /**
32      * Full path to the {@link org.openharmonise.vfs.VirtualFile} that fired this event.
33      */

34     private String JavaDoc m_sPath = null;
35     
36     /**
37      * Virtual file system that the virtual file belongs to.
38      */

39     private AbstractVirtualFileSystem m_vfs = null;
40     
41     private int m_nEventSubType = 0;
42     
43     private String JavaDoc m_sChildPath = null;
44     
45     /**
46      * Identifier for the type of event.
47      */

48     private String JavaDoc m_sEventType = null;
49
50     /**
51      * Identifier for a virtual file locked event.
52      */

53     public static String JavaDoc FILE_LOCKED = "FILE_LOCKED";
54
55     /**
56      * Identifier for a virtual file unlocked event.
57      */

58     public static String JavaDoc FILE_UNLOCKED = "FILE_UNLOCKED";
59
60     /**
61      * Identifier for a virtual file deleted event.
62      */

63     public static String JavaDoc FILE_DELETED = "FILE_DELETED";
64
65     /**
66      * Identifier for a virtual file moved event.
67      */

68     public static String JavaDoc FILE_MOVED = "FILE_MOVED";
69
70     /**
71      * Identifier for a virtual file copied event.
72      */

73     public static String JavaDoc FILE_COPIED = "FILE_COPIED";
74
75     /**
76      * Identifier for a virtual file children changed event.
77      */

78     public static String JavaDoc FILE_MEMBERS_CHANGED = "FILE_MEMBERS_CHANGED";
79
80     /**
81      * Identifier for a virtual file metadata changed event.
82      */

83     public static String JavaDoc FILE_METADATA_CHANGED = "FILE_METADATA_CHANGED";
84
85     /**
86      * Identifier for a virtual file renamed event.
87      */

88     public static String JavaDoc FILE_RENAMED = "FILE_RENAMED";
89
90     /**
91      * Identifier for a virtual file content changed event.
92      */

93     public static String JavaDoc FILE_CONTENT_CHANGED = "FILE_CONTENT_CHANGED";
94
95     /**
96      * Identifier for a virtual file changes discarded event.
97      */

98     public static String JavaDoc FILE_CHANGES_DISCARDED = "FILE_CHANGES_DISCARDED";
99
100     /**
101      * Identifier for a virtual file submitted event.
102      */

103     public static String JavaDoc FILE_SYNCHED = "FILE_SYNCHED";
104
105     /**
106      * Identifier for a virtual file checked in event.
107      */

108     public static String JavaDoc FILE_CHECKED_IN = "FILE_CHECKED_IN";
109
110     /**
111      * Constructs a new virtual file event object.
112      *
113      * @param sPath Full path the virtual file that fired this event
114      * @param vfs Virtual file system that the virtual file belongs to
115      * @param sEventType Identifier for the event type
116      */

117     public VirtualFileEvent(
118         String JavaDoc sPath,
119         AbstractVirtualFileSystem vfs,
120         String JavaDoc sEventType) {
121         super();
122         
123         this.m_sPath = sPath;
124         this.m_vfs = vfs;
125         this.m_sEventType = sEventType;
126     }
127     
128     /**
129      * Returns an identifier for the event type.
130      *
131      * @return Event type
132      */

133     public String JavaDoc getEventType() {
134         return this.m_sEventType;
135     }
136     
137     /**
138      * Returns the full path to the virtual file that fired this event.
139      *
140      * @return Full path
141      */

142     public String JavaDoc getPath() {
143         return this.m_sPath;
144     }
145     
146     /**
147      * Returns the virtual file system that the virtual file belongs to.
148      *
149      * @return Virtual file system
150      */

151     public AbstractVirtualFileSystem getVFS() {
152         return this.m_vfs;
153     }
154     
155     public void setSubType(int nSubType) {
156         this.m_nEventSubType = nSubType;
157     }
158     
159     public int getSubType() {
160         return this.m_nEventSubType;
161     }
162     
163     public void setChildPath(String JavaDoc sChildPath) {
164         this.m_sChildPath = sChildPath;
165     }
166     
167     public String JavaDoc getChildPath() {
168         return this.m_sChildPath;
169     }
170
171 }
172
Popular Tags