@Override public FileBasedBuilderParametersImpl setFile(final File file) { getFileHandler().setFile(file); return this; }
@Override public FileBasedBuilderParametersImpl setBasePath(final String path) { getFileHandler().setBasePath(path); return this; }
@Override public FileBasedBuilderParametersImpl setFileSystem(final FileSystem fs) { getFileHandler().setFileSystem(fs); return this; }
@Override public FileBasedBuilderParametersImpl setPath(final String path) { getFileHandler().setPath(path); return this; }
@Override public FileBasedBuilderParametersImpl setEncoding(final String enc) { getFileHandler().setEncoding(enc); return this; }
@Override public FileBasedBuilderParametersImpl setURL(final URL url) { getFileHandler().setURL(url); return this; }
@Override public FileBasedBuilderParametersImpl setFileName(final String name) { getFileHandler().setFileName(name); return this; }
@Override public FileBasedBuilderParametersImpl setLocationStrategy( final FileLocationStrategy strategy) { getFileHandler().setLocationStrategy(strategy); return this; }
/** * Tries to obtain the current file name from the given list of parameter * objects. * * @param params the parameter objects * @return the file name or <b>null</b> if unspecified */ private static String fetchCurrentFileName( final Collection<BuilderParameters> params) { for (final BuilderParameters p : params) { if (p instanceof FileBasedBuilderParametersImpl) { final FileBasedBuilderParametersImpl fp = (FileBasedBuilderParametersImpl) p; return fp.getFileHandler().getFileName(); } } return null; }
/** * {@inheritDoc} This implementation takes some properties defined in this * class into account. */ @Override public void inheritFrom(final Map<String, ?> source) { super.inheritFrom(source); final FileBasedBuilderParametersImpl srcParams = fromParameters(source); if (srcParams != null) { setFileSystem(srcParams.getFileHandler().getFileSystem()); setLocationStrategy( srcParams.getFileHandler().getLocationStrategy()); if (srcParams.getFileHandler().getEncoding() != null) { setEncoding(srcParams.getFileHandler().getEncoding()); } if (srcParams.getReloadingDetectorFactory() != null) { setReloadingDetectorFactory( srcParams.getReloadingDetectorFactory()); } if (srcParams.getReloadingRefreshDelay() != null) { setReloadingRefreshDelay(srcParams.getReloadingRefreshDelay()); } } }
/** * Obtains the {@code FileHandler} from this builder's parameters. If no * {@code FileBasedBuilderParametersImpl} object is found in this builder's * parameters, a new one is created now and stored. This makes it possible * to change the location of the associated file even if no parameters * object was provided. * * @return the {@code FileHandler} from initialization parameters */ private FileHandler fetchFileHandlerFromParameters() { FileBasedBuilderParametersImpl fileParams = FileBasedBuilderParametersImpl.fromParameters(getParameters(), false); if (fileParams == null) { fileParams = new FileBasedBuilderParametersImpl(); addParameters(fileParams.getParameters()); } return fileParams.getFileHandler(); }