1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.vfs;
18
19
20 /***
21 * Abstract class which has the right to fill FileSystemOptions
22 *
23 * @author <a href="mailto:imario@apache.org">Mario Ivankovits</a>
24 * @version $Revision: 480428 $ $Date: 2006-11-29 07:15:24 +0100 (Mi, 29 Nov 2006) $
25 */
26 public abstract class FileSystemConfigBuilder
27 {
28 protected void setParam(FileSystemOptions opts, String name, Object value)
29 {
30 opts.setOption(getConfigClass(), name, value);
31 }
32
33 protected Object getParam(FileSystemOptions opts, String name)
34 {
35 if (opts == null)
36 {
37 return null;
38 }
39
40 return opts.getOption(getConfigClass(), name);
41 }
42
43 protected boolean hasParam(FileSystemOptions opts, String name)
44 {
45 if (opts == null)
46 {
47 return false;
48 }
49
50 return opts.hasOption(getConfigClass(), name);
51 }
52
53 protected abstract Class getConfigClass();
54 }