Class FileLocator.FileLocatorBuilder
- java.lang.Object
-
- org.apache.commons.configuration2.io.FileLocator.FileLocatorBuilder
-
- Enclosing class:
- FileLocator
public static final class FileLocator.FileLocatorBuilder extends Object
A typical builder implementation for creatingFileLocatorobjects. An instance of this class is returned by thefileLocator()method of {link FileLocatorUtils}. It can be used to define the various components of theFileLocatorobject. By callingcreate()the new immutableFileLocatorinstance is created.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FileLocator.FileLocatorBuilderbasePath(String path)Specifies the base path of the newFileLocator.FileLocatorcreate()Creates a new immutableFileLocatorImplobject based on the properties set so far for this builder.FileLocator.FileLocatorBuilderencoding(String enc)Specifies the encoding of the newFileLocator.FileLocator.FileLocatorBuilderfileName(String name)Specifies the file name of the newFileLocator.FileLocator.FileLocatorBuilderfileSystem(FileSystem fs)Specifies theFileSystemof the newFileLocator.FileLocator.FileLocatorBuilderlocationStrategy(FileLocationStrategy strategy)Specifies theFileLocationStrategyto be used when the referenced file is to be located.FileLocator.FileLocatorBuildersourceURL(URL url)Specifies the source URL of the newFileLocator.FileLocator.FileLocatorBuilderurlConnectionOptions(URLConnectionOptions urlConnectionOptions)Specifies the source URL connection options of the newFileLocator.
-
-
-
Method Detail
-
basePath
public FileLocator.FileLocatorBuilder basePath(String path)
Specifies the base path of the newFileLocator.- Parameters:
path- the base path- Returns:
- a reference to this builder for method chaining
-
create
public FileLocator create()
Creates a new immutableFileLocatorImplobject based on the properties set so far for this builder.- Returns:
- the newly created
FileLocatorobject, never null.
-
encoding
public FileLocator.FileLocatorBuilder encoding(String enc)
Specifies the encoding of the newFileLocator.- Parameters:
enc- the encoding- Returns:
- a reference to this builder for method chaining
-
fileName
public FileLocator.FileLocatorBuilder fileName(String name)
Specifies the file name of the newFileLocator.- Parameters:
name- the file name- Returns:
- a reference to this builder for method chaining
-
fileSystem
public FileLocator.FileLocatorBuilder fileSystem(FileSystem fs)
Specifies theFileSystemof the newFileLocator.- Parameters:
fs- theFileSystem- Returns:
- a reference to this builder for method chaining
-
locationStrategy
public FileLocator.FileLocatorBuilder locationStrategy(FileLocationStrategy strategy)
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
public FileLocator.FileLocatorBuilder sourceURL(URL url)
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
-
-