Class FileLocator.FileLocatorBuilder
java.lang.Object
org.apache.commons.configuration2.io.FileLocator.FileLocatorBuilder
- Enclosing class:
FileLocator
A typical builder implementation for creating
FileLocator objects. An instance of this class is
returned by the fileLocator() method of {link FileLocatorUtils}. It can be used to define the various
components of the FileLocator object. By calling create() the new immutable FileLocator
instance is created.-
Method Summary
Modifier and TypeMethodDescriptionSpecifies the base path of the newFileLocator.create()Creates a new immutableFileLocatorImplobject based on the properties set so far for this builder.Specifies the encoding of the newFileLocator.Specifies the file name of the newFileLocator.fileSystem(FileSystem fs) Specifies theFileSystemof the newFileLocator.locationStrategy(FileLocationStrategy strategy) Specifies theFileLocationStrategyto be used when the referenced file is to be located.Specifies the source URL of the newFileLocator.urlConnectionOptions(URLConnectionOptions urlConnectionOptions) Specifies the source URL connection options of the newFileLocator.
-
Method Details
-
basePath
Specifies the base path of the newFileLocator.- Parameters:
path- the base path- Returns:
- a reference to this builder for method chaining
-
create
Creates a new immutableFileLocatorImplobject based on the properties set so far for this builder.- Returns:
- the newly created
FileLocatorobject, never null.
-
encoding
Specifies the encoding of the newFileLocator.- Parameters:
enc- the encoding- Returns:
- a reference to this builder for method chaining
-
fileName
Specifies the file name of the newFileLocator.- Parameters:
name- the file name- Returns:
- a reference to this builder for method chaining
-
fileSystem
Specifies theFileSystemof the newFileLocator.- Parameters:
fs- theFileSystem- Returns:
- a reference to this builder for method chaining
-
locationStrategy
Specifies theFileLocationStrategyto be used when the referenced file is to be located.- Parameters:
strategy- theFileLocationStrategy- Returns:
- a reference to this builder for method chaining
-
sourceURL
Specifies the source URL of the newFileLocator.- Parameters:
url- the source URL- Returns:
- a reference to this builder for method chaining
-
urlConnectionOptions
public FileLocator.FileLocatorBuilder urlConnectionOptions(URLConnectionOptions urlConnectionOptions) Specifies the source URL connection options of the newFileLocator.- Parameters:
urlConnectionOptions- the source URL connection options.- Returns:
- a reference to this builder for method chaining
-