io.deepsense.neptune.clientlibrary.config.user.FileBasedUserConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of neptune-client-library Show documentation
Show all versions of neptune-client-library Show documentation
Enables integration with Neptune in your Java code
/**
* Copyright (c) 2016, CodiLime Inc.
*/
package io.deepsense.neptune.clientlibrary.config.user;
import com.google.common.base.Preconditions;
import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.HierarchicalINIConfiguration;
import java.io.File;
public final class FileBasedUserConfiguration extends StaticUserConfiguration {
public static FileBasedUserConfiguration create(File configFile) throws ConfigurationException {
Preconditions.checkNotNull(configFile);
Configuration iniConfiguration = new HierarchicalINIConfiguration(configFile);
return new FileBasedUserConfiguration(
iniConfiguration.getString("Neptune.username"),
iniConfiguration.getString("Neptune.password"));
}
private FileBasedUserConfiguration(String username, String password) {
super(username, password);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy