public class ProvidedURLLocationStrategy extends Object implements FileLocationStrategy
A specialized implementation of
FileLocationStrategy which checks
whether a passed in
FileLocator already has a defined URL.
FileLocator objects that have a URL already reference a file in an
unambiguous way. Therefore, this strategy just returns the URL of the passed
FileLocator. It can be used as a first step of the file resolving
process. If it fails, more sophisticated attempts for resolving the file can
|Constructor and Description|
|Modifier and Type||Method and Description|
Tries to locate the specified file.
public URL locate(FileSystem fileSystem, FileLocator locator)
FileSystemto be used. Note that the
FileLocatorobject may also contain a
FileSystem, but this is optional. The passed in
FileSystemshould be used, and callers must not pass a null reference for this argument. A concrete implementation has to evaluate the properties stored in the
FileLocatorobject and try to match them to an existing file. If this can be done, a corresponding URL is returned. Otherwise, result is null. Implementations should not throw an exception (unless parameters are null) as there might be alternative strategies which can find the file in question. This implementation just returns the URL stored in the given
Copyright © 2001–2017 The Apache Software Foundation. All rights reserved.