01: /*
02: * Created on Feb 12, 2004
03: *
04: * To change the template for this generated file go to
05: * Window>Preferences>Java>Code Generation>Code and Comments
06: */
07: package org.xdev.base.xssl.io;
08:
09: import java.util.HashMap;
10:
11: import org.xdev.base.xssl.XSSLObject;
12:
13: import java.io.File;
14:
15: /**
16: * @author AYegorov
17: *
18: * To change the template for this generated type comment go to
19: * Window>Preferences>Java>Code Generation>Code and Comments
20: */
21: public abstract class AbstractFile extends XSSLObject {
22: public static final String DIR = "dir";
23:
24: /**
25: * @param id
26: */
27: public AbstractFile(String id) {
28: super (id);
29: // XXX Auto-generated constructor stub
30: }
31:
32: /**
33: * @param id
34: * @param properties
35: */
36: public AbstractFile(String id, HashMap properties) {
37: super (id, properties);
38: // XXX Auto-generated constructor stub
39: }
40:
41: /* (non-Javadoc)
42: * @see org.xdev.base.xssl.XSSLObject#processObject(java.lang.Object)
43: */
44: protected Object processObject(Object obj) throws Exception {
45:
46: if (obj == null && this .hasProperty(AbstractFile.DIR)) {
47: obj = new File(this .getProperty(AbstractFile.DIR));
48: }
49:
50: return this .processFile((File) obj);
51: }
52:
53: protected abstract Object processFile(File f) throws Exception;
54: }
|