Tag: ini

如何在spring批处理中读取ini文件(key = value)

我想创建一个批处理使用Spring批处理从ini文件中读取数据并将数据保存在数据库中但是当我查询org.springframework.batch.item.file.FlatFileItemReader类时,我没有找到解析数据的方法在ini文件中,我试图将ini4j API与spring批处理相结合但没有结果 我的ini文件: [Cat] a=1 b= 2 c= 3 d= 4 e= 5 f= 6 [Cat2] a=11 b= 21 c= 31 d= 41 e= 51 f= 61

将值传递给Shiro ini中的枚举属性

我正在使用JDBC Realm并在SQL中存储身份validation数据。 我将salt存储在users表中并依赖于DEFAULT_SALTED_AUTHENICATION_QUERY。 要调用该查询,我必须设置SaltStyle。 因此,我需要通过INI将SaltStyle.COLUMN枚举值传递给JdbcRealm。 SaltStyle不是类,所以我无法创建引用 无论我做什么传递都会产生此错误= org.apache.shiro.config.UnresolveableReferenceException: 无法从文档中的详尽搜索或参考中找到示例。 任何帮助深表感谢。 #==================================================================== # Shiro INI configuration # # =================================================================== [main] JdbcRealm=org.apache.shiro.realm.jdbc.JdbcRealm JdbcRealm.permissionsLookupEnabled = true sha256Matcher = org.apache.shiro.authc.credential.HashedCredentialsMatcher sha256Matcher.hashAlgorithmName=SHA-256 sha256Matcher.hashIterations=1 JdbcRealm.credentialsMatcher = $sha256Matcher JdbcRealm.saltStyle= enum expression needed here 这是JdbcRealm中的属性 public void setSaltStyle(SaltStyle saltStyle) { this.saltStyle = saltStyle; if (saltStyle == SaltStyle.COLUMN && authenticationQuery.equals (DEFAULT_AUTHENTICATION_QUERY)) { authenticationQuery = […]