/** * Returns a {@code FileLocatorBuilder} which is already initialized with * the properties of the passed in {@code FileLocator}. This builder can * be used to create a {@code FileLocator} object which shares properties * of the original locator (e.g. the {@code FileSystem} or the encoding), * but points to a different file. An example use case is as follows: * <pre> * FileLocator loc1 = ... * FileLocator loc2 = FileLocatorUtils.fileLocator(loc1) * .setFileName("anotherTest.xml") * .create(); * </pre> * @param src the source {@code FileLocator} (may be <b>null</b>) * @return an initialized builder object for defining a {@code FileLocator} */ public static FileLocator.FileLocatorBuilder fileLocator(final FileLocator src) { return new FileLocator.FileLocatorBuilder(src); }