本文整理了Java中org.apache.felix.utils.properties.Properties.isEmpty()
方法的一些代码示例,展示了Properties.isEmpty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Properties.isEmpty()
方法的具体详情如下:
包路径:org.apache.felix.utils.properties.Properties
类名称:Properties
方法名:isEmpty
暂无
代码示例来源:origin: io.fabric8/fabric-boot-commands
Properties userProps = new Properties(propsPath.toFile());
if (userProps.isEmpty()) {
String[] credentials = promptForNewUser(newUser, newUserPassword);
newUser = credentials[0];
代码示例来源:origin: jboss-fuse/fabric8
if (userProps.isEmpty()) {
userProps.put(DEFAULT_ADMIN_USER, decodedZookeeperPassword+ ROLE_DELIMITER + DEFAULT_ADMIN_ROLE);
代码示例来源:origin: jboss-fuse/fabric8
newUserPassword = newUserPassword != null ? newUserPassword : ShellUtils.retrieveFabricUserPassword(session);
if (userProps.isEmpty()) {
String[] credentials = promptForNewUser(newUser, newUserPassword);
newUser = credentials[0];
代码示例来源:origin: io.fabric8/fabric-zookeeper
void configureInternal(Map<String, ?> conf) throws Exception {
configuration = configurer.configure(conf, this);
if (Strings.isNullOrBlank(runtimeId)) {
throw new IllegalArgumentException("Runtime id must not be null or empty.");
}
if (Strings.isNullOrBlank(localResolver)) {
localResolver = globalResolver;
}
String decodedZookeeperPassword = null;
Properties userProps = new Properties();
try {
userProps.load(new File(confDir , "users.properties"));
} catch (IOException e) {
LOGGER.warn("Failed to load users from etc/users.properties. No users will be imported.", e);
}
if (Strings.isNotBlank(zookeeperPassword)) {
decodedZookeeperPassword = PasswordEncoder.decode(zookeeperPassword);
} else if (userProps.containsKey(DEFAULT_ADMIN_USER)) {
String passwordAndRole = userProps.getProperty(DEFAULT_ADMIN_USER).trim();
decodedZookeeperPassword = passwordAndRole.substring(0, passwordAndRole.indexOf(ROLE_DELIMITER));
} else {
decodedZookeeperPassword = PasswordEncoder.encode(CreateEnsembleOptions.generatePassword());
}
if (userProps.isEmpty()) {
userProps.put(DEFAULT_ADMIN_USER, decodedZookeeperPassword+ ROLE_DELIMITER + DEFAULT_ADMIN_ROLE);
}
options = CreateEnsembleOptions.builder().bindAddress(bindAddress).agentEnabled(agentAutoStart).ensembleStart(ensembleAutoStart).zookeeperPassword(decodedZookeeperPassword)
.zooKeeperServerPort(zookeeperServerPort).zooKeeperServerConnectionPort(zookeeperServerConnectionPort).autoImportEnabled(profilesAutoImport)
.importPath(profilesAutoImportPath).resolver(localResolver).globalResolver(globalResolver).users(userProps).profiles(profiles).version(version).build();
}
内容来源于网络,如有侵权,请联系作者删除!