01: /*
02: * Copyright 2005 Joe Walker
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.directwebremoting.fsguide.visitors;
17:
18: import java.io.File;
19:
20: import org.apache.commons.logging.Log;
21: import org.apache.commons.logging.LogFactory;
22: import org.directwebremoting.dwrp.BaseCallMarshaller;
23: import org.directwebremoting.fsguide.Visitor;
24:
25: /**
26: * A debugging visitor that simply prints out the files and directories that it
27: * visits.
28: */
29: public class SystemOutVisitor implements Visitor {
30: /* (non-Javadoc)
31: * @see com.barclaycard.fsguide.Visitor#visitFile(java.io.File)
32: */
33: public void visitFile(File file) {
34: log.info("File: " + file.getAbsolutePath());
35: }
36:
37: /* (non-Javadoc)
38: * @see com.barclaycard.fsguide.Visitor#visitDirectory(java.io.File)
39: */
40: public boolean visitDirectory(File directory) {
41: log.info("Directory: " + directory.getAbsolutePath());
42: return true;
43: }
44:
45: /**
46: * The log stream
47: */
48: protected static final Log log = LogFactory
49: .getLog(BaseCallMarshaller.class);
50: }
|