View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.commons.vfs2;
18  
19  import java.time.Duration;
20  import java.util.Objects;
21  import java.util.function.Function;
22  
23  import org.apache.commons.lang3.StringUtils;
24  import org.apache.commons.lang3.time.DurationUtils;
25  
26  /**
27   * Abstracts configuring {@link FileSystemOptions}s.
28   */
29  public abstract class FileSystemConfigBuilder {
30  
31      /** Default prefix to use when resolving system properties */
32      private static final String PREFIX = "vfs.";
33  
34      /** The root URI of the file system */
35      private static final String ROOTURI = "rootURI";
36  
37      /** The prefix to use when resolving system properties */
38      private final String prefix;
39  
40      /**
41       * Constructs builder with default prefix.
42       *
43       * @since 1.0
44       */
45      protected FileSystemConfigBuilder() {
46          prefix = PREFIX;
47      }
48  
49      /**
50       * Constructs builder with specified component name.
51       *
52       * @param component component name to be used in prefix
53       * @since 2.0
54       */
55      protected FileSystemConfigBuilder(final String component) {
56          prefix = PREFIX + component;
57      }
58  
59      /**
60       * Gets a named option as a Boolean.
61       *
62       * @param fileSystemOptions file system options to query, may be null.
63       * @param name the option name
64       * @return the option in {@code opts} or system properties, otherwise null
65       * @see #getBoolean(FileSystemOptions, String, Boolean)
66       * @since 2.0
67       */
68      protected Boolean getBoolean(final FileSystemOptions fileSystemOptions, final String name) {
69          return getBoolean(fileSystemOptions, name, null);
70      }
71  
72      /**
73       * Gets a named option as a Boolean.
74       *
75       * @param fileSystemOptions file system options to query, may be null.
76       * @param name the option name
77       * @param defaultValue value to return if option is not present
78       * @return the option in {@code opts} or system properties, otherwise {@code defaultValue}
79       * @see #getBoolean(FileSystemOptions, String, Boolean)
80       * @since 2.0
81       */
82      protected boolean getBoolean(final FileSystemOptions fileSystemOptions, final String name,
83          final boolean defaultValue) {
84          return getBoolean(fileSystemOptions, name, Boolean.valueOf(defaultValue)).booleanValue();
85      }
86  
87      /**
88       * Gets a named option as a Boolean.
89       *
90       * @param fileSystemOptions file system options to query, may be null.
91       * @param name the option name
92       * @param defaultValue value to return if option is not present
93       * @return the option in {@code opts} or system properties, otherwise {@code defaultValue}
94       * @see #getBoolean(FileSystemOptions, String, Boolean)
95       * @since 2.0
96       */
97      protected Boolean getBoolean(final FileSystemOptions fileSystemOptions, final String name,
98          final Boolean defaultValue) {
99          return getParam(fileSystemOptions, name, defaultValue, Boolean::valueOf);
100     }
101 
102     /**
103      * Gets a named option as a Byte.
104      *
105      * @param fileSystemOptions file system options to query, may be null.
106      * @param name the option name
107      * @return the option in {@code opts} or system properties, otherwise null
108      * @see #getByte(FileSystemOptions, String, Byte)
109      * @since 2.0
110      */
111     protected Byte getByte(final FileSystemOptions fileSystemOptions, final String name) {
112         return getByte(fileSystemOptions, name, null);
113     }
114 
115     /**
116      * Gets a named option as a Byte.
117      *
118      * @param fileSystemOptions file system options to query, may be null.
119      * @param name the option name
120      * @param defaultValue value to return if option is not present
121      * @return the option in {@code opts} or system properties, otherwise {@code defaultValue}
122      * @see #getByte(FileSystemOptions, String, Byte)
123      * @since 2.0
124      */
125     protected byte getByte(final FileSystemOptions fileSystemOptions, final String name, final byte defaultValue) {
126         return getByte(fileSystemOptions, name, Byte.valueOf(defaultValue)).byteValue();
127     }
128 
129     /**
130      * Gets a named option as a Byte.
131      *
132      * @param fileSystemOptions file system options to query, may be null.
133      * @param name the option name
134      * @param defaultValue value to return if option is not present
135      * @return the option in {@code opts} or system properties, otherwise {@code defaultValue}
136      * @since 2.0
137      */
138     protected Byte getByte(final FileSystemOptions fileSystemOptions, final String name, final Byte defaultValue) {
139         return getParam(fileSystemOptions, name, defaultValue, Byte::valueOf);
140     }
141 
142     /**
143      * Gets a named option as a Character.
144      *
145      * @param fileSystemOptions file system options to query, may be null.
146      * @param name the option name
147      * @return the option in {@code opts} or system properties, otherwise null
148      * @see #getCharacter(FileSystemOptions, String, Character)
149      * @since 2.0
150      */
151     protected Character getCharacter(final FileSystemOptions fileSystemOptions, final String name) {
152         return getCharacter(fileSystemOptions, name, null);
153     }
154 
155     /**
156      * Gets a named option as a Character.
157      *
158      * @param fileSystemOptions file system options to query, may be null.
159      * @param name the option name
160      * @param defaultValue value to return if option is not present
161      * @return the option in {@code opts} or system properties, otherwise {@code defaultValue}
162      * @see #getCharacter(FileSystemOptions, String, Character)
163      * @since 2.0
164      */
165     protected char getCharacter(final FileSystemOptions fileSystemOptions, final String name, final char defaultValue) {
166         return getCharacter(fileSystemOptions, name, Character.valueOf(defaultValue)).charValue();
167     }
168 
169     /**
170      * Gets a named option as a Character.
171      *
172      * @param fileSystemOptions file system options to query, may be null.
173      * @param name the option name
174      * @param defaultValue value to return if option is not present
175      * @return the option in {@code opts} or system properties, otherwise {@code defaultValue}
176      * @since 2.0
177      */
178     protected Character getCharacter(final FileSystemOptions fileSystemOptions, final String name,
179         final Character defaultValue) {
180         Character value = getParam(fileSystemOptions, name);
181         if (value == null) {
182             final String str = getProperty(name);
183             if (StringUtils.isEmpty(str)) {
184                 return defaultValue;
185             }
186             value = Character.valueOf(str.charAt(0));
187         }
188         return value;
189     }
190 
191     /**
192      * Gets the target of this configuration.
193      *
194      * @return the specific file system class
195      * @since 1.0
196      */
197     protected abstract Class<? extends FileSystem> getConfigClass();
198 
199     /**
200      * Gets a named option as a Double.
201      *
202      * @param fileSystemOptions file system options to query, may be null.
203      * @param name the option name
204      * @return the option in {@code opts} or system properties, otherwise null
205      * @see #getDouble(FileSystemOptions, String, Double)
206      * @since 2.0
207      */
208     protected Double getDouble(final FileSystemOptions fileSystemOptions, final String name) {
209         return getDouble(fileSystemOptions, name, null);
210     }
211 
212     /**
213      * Gets a named option as a Double.
214      *
215      * @param fileSystemOptions file system options to query, may be null.
216      * @param name the option name
217      * @param defaultValue value to return if option is not present
218      * @return the option in {@code opts} or system properties, otherwise {@code defaultValue}
219      * @see #getDouble(FileSystemOptions, String, Double)
220      * @since 2.0
221      */
222     protected double getDouble(final FileSystemOptions fileSystemOptions, final String name,
223         final double defaultValue) {
224         return getDouble(fileSystemOptions, name, Double.valueOf(defaultValue)).doubleValue();
225     }
226 
227     /**
228      * Gets a named option as a Double.
229      *
230      * @param fileSystemOptions file system options to query, may be null.
231      * @param name the option name
232      * @param defaultValue value to return if option is not present
233      * @return the option in {@code opts} or system properties, otherwise {@code defaultValue}
234      * @since 2.0
235      */
236     protected Double getDouble(final FileSystemOptions fileSystemOptions, final String name,
237         final Double defaultValue) {
238         return getParam(fileSystemOptions, name, defaultValue, Double::valueOf);
239     }
240 
241     /**
242      * Gets a named option as a Duration.
243      *
244      * @param fileSystemOptions file system options to query, may be null.
245      * @param name the option name
246      * @return the option in {@code opts} or system properties, otherwise null
247      * @see #getLong(FileSystemOptions, String, Long)
248      * @since 2.8.0
249      */
250     protected Duration getDuration(final FileSystemOptions fileSystemOptions, final String name) {
251         return getDuration(fileSystemOptions, name, null);
252     }
253 
254     /**
255      * Gets a named option as a Duration.
256      *
257      * @param fileSystemOptions file system options to query, may be null.
258      * @param name the option name
259      * @param defaultValue value to return if option is not present
260      * @return the option in {@code opts} or system properties, otherwise {@code defaultValue}
261      * @since 2.8.0
262      */
263     protected Duration getDuration(final FileSystemOptions fileSystemOptions, final String name,
264         final Duration defaultValue) {
265         return getParam(fileSystemOptions, name, defaultValue, Duration::parse);
266     }
267 
268     /**
269      * Gets a named option as a Duration bound to the integer range.
270      *
271      * @param fileSystemOptions file system options to query, may be null.
272      * @param name the option name
273      * @return the option in {@code opts} or system properties, otherwise null
274      * @see #getLong(FileSystemOptions, String, Long)
275      * @since 2.8.0
276      */
277     protected Integer getDurationInteger(final FileSystemOptions fileSystemOptions, final String name) {
278         return getDurationInteger(fileSystemOptions, name, null);
279     }
280 
281     /**
282      * Gets a named option as a Duration bound to the integer range.
283      *
284      * @param fileSystemOptions file system options to query, may be null.
285      * @param name the option name
286      * @param defaultValue value to return if option is not present
287      * @return the option in {@code opts} or system properties, otherwise {@code defaultValue}
288      * @since 2.8.0
289      */
290     protected Integer getDurationInteger(final FileSystemOptions fileSystemOptions, final String name,
291         final Duration defaultValue) {
292         return DurationUtils.toMillisInt(getParam(fileSystemOptions, name, defaultValue, Duration::parse));
293     }
294 
295     /**
296      *Gets a named option as a Double.
297      *
298      * @param <E> enumeration type
299      * @param enumClass class of enumeration type
300      * @param fileSystemOptions file system options to query, may be null.
301      * @param name the option name *
302      * @return the option in {@code opts} or system properties, otherwise null
303      * @see #getEnum(Class, FileSystemOptions, String, Enum)
304      * @throws IllegalArgumentException if option value is not a known enumeration.
305      * @since 2.1
306      */
307     protected <E extends Enum<E>> E getEnum(final Class<E> enumClass, final FileSystemOptions fileSystemOptions,
308         final String name) {
309         return this.getEnum(enumClass, fileSystemOptions, name, null);
310     }
311 
312     /**
313      * Gets a named option as an Enum.
314      *
315      * @param <E> enumeration type
316      * @param enumClass class of enumeration type
317      * @param fileSystemOptions file system options to query, may be null.
318      * @param name the option name
319      * @param defaultValue value to return if option is not present
320      * @return the option in {@code opts} or system properties, otherwise {@code defaultValue}
321      * @see #getEnum(Class, FileSystemOptions, String, Enum)
322      * @throws IllegalArgumentException if option value is not a known enumeration.
323      * @since 2.1
324      */
325     protected <E extends Enum<E>> E getEnum(final Class<E> enumClass, final FileSystemOptions fileSystemOptions,
326         final String name, final E defaultValue) {
327         E value = getParam(fileSystemOptions, name);
328         if (value == null) {
329             final String str = getProperty(name);
330             if (str == null) {
331                 return defaultValue;
332             }
333             value = Enum.valueOf(enumClass, str);
334         }
335         return value;
336     }
337 
338     /**
339      * Gets a named option as a Float.
340      *
341      * @param fileSystemOptions file system options to query, may be null.
342      * @param name the option name
343      * @return the option in {@code opts} or system properties, otherwise null
344      * @see #getFloat(FileSystemOptions, String, Float)
345      * @throws NumberFormatException if option value is not a valid float.
346      * @since 2.0
347      */
348     protected Float getFloat(final FileSystemOptions fileSystemOptions, final String name) {
349         return getFloat(fileSystemOptions, name, null);
350     }
351 
352     /**
353      * Gets a named option as a Float.
354      *
355      * @param fileSystemOptions file system options to query, may be null.
356      * @param name the option name
357      * @param defaultValue value to return if option is not present
358      * @return the option in {@code opts} or system properties, otherwise {@code defaultValue}
359      * @see #getFloat(FileSystemOptions, String, Float)
360      * @throws NumberFormatException if option value is not a valid float.
361      * @since 2.0
362      */
363     protected float getFloat(final FileSystemOptions fileSystemOptions, final String name, final float defaultValue) {
364         return getFloat(fileSystemOptions, name, Float.valueOf(defaultValue)).floatValue();
365     }
366 
367     /**
368      * Gets a named option as a Float.
369      *
370      * @param fileSystemOptions file system options to query, may be null.
371      * @param name the option name
372      * @param defaultValue value to return if option is not present
373      * @return the option in {@code opts} or system properties, otherwise {@code defaultValue}
374      * @throws NumberFormatException if option value is not a valid float.
375      * @since 2.0
376      */
377     protected Float getFloat(final FileSystemOptions fileSystemOptions, final String name, final Float defaultValue) {
378         return getParam(fileSystemOptions, name, defaultValue, Float::valueOf);
379     }
380 
381     /**
382      * Gets a named option as an Integer.
383      *
384      * @param fileSystemOptions file system options to query, may be null.
385      * @param name the option name
386      * @return the option in {@code opts} or system properties, otherwise null
387      * @see #getInteger(FileSystemOptions, String, Integer)
388      * @throws NumberFormatException if option value is not a valid integer.
389      * @since 2.0
390      */
391     protected Integer getInteger(final FileSystemOptions fileSystemOptions, final String name) {
392         return getInteger(fileSystemOptions, name, null);
393     }
394 
395     /**
396      * Gets a named option as an Integer.
397      *
398      * @param fileSystemOptions file system options to query, may be null.
399      * @param name the option name
400      * @param defaultValue value to return if option is not present
401      * @return the option in {@code opts} or system properties, otherwise {@code defaultValue}
402      * @see #getInteger(FileSystemOptions, String, Integer)
403      * @throws NumberFormatException if option value is not a valid integer.
404      * @since 2.0
405      */
406     protected int getInteger(final FileSystemOptions fileSystemOptions, final String name, final int defaultValue) {
407         return getInteger(fileSystemOptions, name, Integer.valueOf(defaultValue)).intValue();
408     }
409 
410     /**
411      * Gets a named option as an Integer.
412      *
413      * @param fileSystemOptions file system options to query, may be null.
414      * @param name the option name
415      * @param defaultValue value to return if option is not present
416      * @return the option in {@code opts} or system properties, otherwise {@code defaultValue}
417      * @throws NumberFormatException if option value is not a valid integer.
418      * @since 2.0
419      */
420     protected Integer getInteger(final FileSystemOptions fileSystemOptions, final String name,
421         final Integer defaultValue) {
422         return getParam(fileSystemOptions, name, defaultValue, Integer::valueOf);
423     }
424 
425     /**
426      * Gets a named option as a Long.
427      *
428      * @param fileSystemOptions file system options to query, may be null.
429      * @param name the option name
430      * @return the option in {@code opts} or system properties, otherwise null
431      * @see #getLong(FileSystemOptions, String, Long)
432      * @throws NumberFormatException if option value is not a valid long.
433      * @since 2.0
434      */
435     protected Long getLong(final FileSystemOptions fileSystemOptions, final String name) {
436         return getLong(fileSystemOptions, name, null);
437     }
438 
439     /**
440      * Gets a named option as a Long.
441      *
442      * @param fileSystemOptions file system options to query, may be null.
443      * @param name the option name
444      * @param defaultValue value to return if option is not present
445      * @return the option in {@code opts} or system properties, otherwise {@code defaultValue}
446      * @see #getLong(FileSystemOptions, String, Long)
447      * @throws NumberFormatException if option value is not a valid long.
448      * @since 2.0
449      */
450     protected long getLong(final FileSystemOptions fileSystemOptions, final String name, final long defaultValue) {
451         return getLong(fileSystemOptions, name, Long.valueOf(defaultValue)).longValue();
452     }
453 
454     /**
455      * Gets a named option as a Long.
456      *
457      * @param fileSystemOptions file system options to query, may be null.
458      * @param name the option name
459      * @param defaultValue value to return if option is not present
460      * @return the option in {@code opts} or system properties, otherwise {@code defaultValue}
461      * @throws NumberFormatException if option value is not a valid long.
462      * @since 2.0
463      */
464     protected Long getLong(final FileSystemOptions fileSystemOptions, final String name, final Long defaultValue) {
465         return getParam(fileSystemOptions, name, defaultValue, Long::valueOf);
466     }
467 
468     /**
469      * Gets a named parameter.
470      *
471      * @param <T> The expected return type.
472      * @param fileSystemOptions file system options to query, may be null.
473      * @param name get option with this name
474      * @return the named option or null
475      * @since 1.0
476      */
477     protected <T> T getParam(final FileSystemOptions fileSystemOptions, final String name) {
478         return fileSystemOptions == null ? null : fileSystemOptions.getOption(getConfigClass(), name);
479     }
480 
481     /**
482      * Gets a named parameter.
483      *
484      * @param <T> The expected return type.
485      * @param fileSystemOptions file system options to query, may be null.
486      * @param name get option with this name
487      * @param defaultValue value to use if the system property value is null.
488      * @param function Builds an instance of T from a system property String value.
489      * @return the named option or null
490      * @since 2.8.0
491      */
492     private <T> T getParam(final FileSystemOptions fileSystemOptions, final String name, final T defaultValue,
493         final Function<String, T> function) {
494         T value = getParam(fileSystemOptions, name);
495         if (value == null) {
496             final String str = getProperty(name);
497             if (str == null) {
498                 return defaultValue;
499             }
500             if (function != null) {
501                 value = function.apply(str);
502             }
503         }
504         return value;
505     }
506 
507     /**
508      * Gets a named parameter.
509      *
510      * @param <T> The expected return type.
511      * @param fileSystemOptions file system options to query, may be null.
512      * @param name get option with this name
513      * @param defaultValue The default value if absent.
514      * @return the named option or {@code defaultValue}.
515      * @since 2.10.0
516      */
517     protected <T> T getParamOrDefault(final FileSystemOptions fileSystemOptions, final String name, final T defaultValue) {
518         return fileSystemOptions == null ? defaultValue : fileSystemOptions.getOptionOrDefault(getConfigClass(), name, defaultValue);
519     }
520 
521     /**
522      * Gets the system property for the given name.
523      *
524      * @param name The name to lookup combined with the prefix.
525      * @return a system property or null
526      * @since 2.1
527      */
528     private String getProperty(final String name) {
529         return System.getProperty(toPropertyKey(name));
530     }
531 
532     /**
533      * Gets the root URI of the file system.
534      *
535      * @param fileSystemOptions file system options to query, may be null.
536      * @return The root URI, or null.
537      * @since 2.0
538      */
539     public String getRootURI(final FileSystemOptions fileSystemOptions) {
540         return getString(fileSystemOptions, ROOTURI);
541     }
542 
543     /**
544      * Gets a named option as a Short.
545      *
546      * @param fileSystemOptions file system options to query, may be null.
547      * @param name the option name
548      * @return the option in {@code opts} or system properties, otherwise null
549      * @see #getShort(FileSystemOptions, String, Short)
550      * @throws NumberFormatException if option value is not a valid short.
551      * @since 2.0
552      */
553     protected Short getShort(final FileSystemOptions fileSystemOptions, final String name) {
554         return getShort(fileSystemOptions, name, null);
555     }
556 
557     /**
558      * Gets a named option as a Short.
559      *
560      * @param fileSystemOptions file system options to query, may be null.
561      * @param name the option name
562      * @param defaultValue value to return if option is not present
563      * @return the option in {@code opts} or system properties, otherwise {@code defaultValue}
564      * @see #getShort(FileSystemOptions, String, Short)
565      * @throws NumberFormatException if option value is not a valid short
566      * @since 2.0
567      */
568     protected short getShort(final FileSystemOptions fileSystemOptions, final String name, final short defaultValue) {
569         return getShort(fileSystemOptions, name, Short.valueOf(defaultValue)).shortValue();
570     }
571 
572     /**
573      * Gets a named option as a Short.
574      *
575      * @param fileSystemOptions file system options to query, may be null.
576      * @param name the option name
577      * @param defaultValue value to return if option is not present
578      * @return the option in {@code opts} or system properties, otherwise {@code defaultValue}
579      * @throws NumberFormatException if option value is not a valid short
580      * @since 2.0
581      */
582     protected Short getShort(final FileSystemOptions fileSystemOptions, final String name, final Short defaultValue) {
583         return getParam(fileSystemOptions, name, defaultValue, Short::valueOf);
584     }
585 
586     /**
587      * Gets a named option as a String.
588      *
589      * @param fileSystemOptions file system options to query, may be null.
590      * @param name the option name
591      * @return the option in {@code opts} or system properties, otherwise null
592      * @see #getString(FileSystemOptions, String, String)
593      * @since 2.0
594      */
595     protected String getString(final FileSystemOptions fileSystemOptions, final String name) {
596         return getString(fileSystemOptions, name, null);
597     }
598 
599     /**
600      * Gets a named option as a String.
601      *
602      * @param fileSystemOptions file system options to query, may be null.
603      * @param name the option name
604      * @param defaultValue value to return if option is not present
605      * @return the option in {@code opts} or system properties, otherwise {@code defaultValue}
606      * @since 2.0
607      */
608     protected String getString(final FileSystemOptions fileSystemOptions, final String name,
609         final String defaultValue) {
610         return getParam(fileSystemOptions, name, defaultValue, String::valueOf);
611     }
612 
613     /**
614      * Checks the named setting specified.
615      *
616      * @param fileSystemOptions file system options to query, may be null.
617      * @param name the option to check in {@code opts} or system properties
618      * @return true if option exists
619      * @since 2.0
620      */
621     protected boolean hasObject(final FileSystemOptions fileSystemOptions, final String name) {
622         return hasParam(fileSystemOptions, name) || System.getProperties().containsKey(toPropertyKey(name));
623     }
624 
625     /**
626      * Checks if option exists.
627      *
628      * @param fileSystemOptions file system options to query, may be null.
629      * @param name the name to look up in {@code opts}
630      * @return true if opts have the named parameter
631      * @since 1.0
632      */
633     protected boolean hasParam(final FileSystemOptions fileSystemOptions, final String name) {
634         return fileSystemOptions != null && fileSystemOptions.hasOption(getConfigClass(), name);
635     }
636 
637     /**
638      * Sets the named parameter.
639      *
640      * @param fileSystemOptions the file system options to modify
641      * @param name set option with this name
642      * @param value boolean value to set
643      * @since 2.1
644      */
645     protected void setParam(final FileSystemOptions fileSystemOptions, final String name, final boolean value) {
646         setParam(fileSystemOptions, name, Boolean.valueOf(value));
647     }
648 
649     /**
650      * Sets the named parameter.
651      *
652      * @param fileSystemOptions the file system options to modify
653      * @param name set option with this name
654      * @param value object value to set
655      * @since 1.0
656      */
657     protected void setParam(final FileSystemOptions fileSystemOptions, final String name, final Object value) {
658         Objects.requireNonNull(fileSystemOptions, "fileSystemOptions").setOption(getConfigClass(), name, value);
659     }
660 
661     /**
662      * Sets the root URI of the file system.
663      *
664      * @param fileSystemOptions the file system options to modify
665      * @param rootURI The creator name to be associated with the file.
666      * @since 2.0
667      */
668     public void setRootURI(final FileSystemOptions fileSystemOptions, final String rootURI) {
669         setParam(fileSystemOptions, ROOTURI, rootURI);
670     }
671 
672     /**
673      * Converts the given primitive boolean to a Boolean object.
674      *
675      * @param value a primitive boolean.
676      * @return the given primitive boolean as Boolean object.
677      * @since 2.7.0
678      */
679     protected Boolean toBooleanObject(final boolean value) {
680         return value ? Boolean.TRUE : Boolean.FALSE;
681     }
682 
683     /**
684      * Converts the given name into a System property key.
685      *
686      * @param name a name to combine with the builder prefix
687      * @return name of system property
688      * @since 2.1
689      */
690     private String toPropertyKey(final String name) {
691         return prefix + name;
692     }
693 
694 }