Class AbstractFileLocationStrategy.AbstractBuilder<T extends FileLocationStrategy,B extends AbstractFileLocationStrategy.AbstractBuilder<T,B>>
- Type Parameters:
T- The type ofFileLocationStrategyto build.B- The builder type.
- All Implemented Interfaces:
org.apache.commons.io.function.IOSupplier<T>
- Direct Known Subclasses:
AbstractFileLocationStrategy.StrategyBuilder,CombinedLocationStrategy.Builder,HomeDirectoryLocationStrategy.Builder
- Enclosing class:
AbstractFileLocationStrategy
As of version 2.15.0, by default, the only URL schemes allowed are file and jar. To override this default, you can either use the system
property org.apache.commons.configuration2.io.FileLocationStrategy.schemes or build a subclass of AbstractFileLocationStrategy.
The system property org.apache.commons.configuration2.io.FileLocationStrategy.schemes String value must be a comma-separated list of schemes,
where the default is "file,jar", and the complete list is "file,http,https,jar".
The root builder for AbstractFileLocationStrategy is AbstractFileLocationStrategy.AbstractBuilder where you define allowed schemes and hosts through its setter
methods.
See AbstractFileLocationStrategy learn how to grant an deny URL schemes and hosts.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets enabled URL-based hosts, empty means all are enabled.setHostsRegEx(Set<String> hosts) Sets enabled URL-based hosts, empty means all are enabled.setSchemes(Set<String> schemes) Sets enabled URL-based schemes, empty means all are enabled.Methods inherited from class org.apache.commons.io.build.AbstractSupplier
asThisMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.commons.io.function.IOSupplier
asSupplier, get, getUnchecked
-
Constructor Details
-
AbstractBuilder
public AbstractBuilder()Constructs a new instance for subclasses.
-
-
Method Details
-
setHosts
Sets enabled URL-based hosts, empty means all are enabled. URL hosts are case-insensitive.- Parameters:
hosts- enabled URL-based hosts.- Returns:
thisinstance.
-
setHostsRegEx
Sets enabled URL-based hosts, empty means all are enabled. URL hosts are case-insensitive.- Parameters:
hosts- Regular expressions enabled URL-based hosts.- Returns:
thisinstance.
-
setSchemes
Sets enabled URL-based schemes, empty means all are enabled. URL schemes are case-insensitive.- Parameters:
schemes- enabled URL-based schemes, the default null means all schemes are allowed.- Returns:
thisinstance.
-