rules.properties :
rule1.id=callagent
rule1.name=Longest Waiting 1
rule1.type=custom
rule1.class=com.brekeke.ctiserver.acd.RuleCallAgent
rule1.description=Assign a call to an agent who has been waiting the longest.
rule1.param1.target=agent_id
rule1.param1.label=Timeout (sec)
rule1.param2.label=Queue size
rule1.param3.label=Next number
rule1.param4.label=Next number14
rule2.id=test
rule2.name=High Skill 1
rule2.type=custom
rule2.description=Find an agent who has the highest skill.
rule2.rule1.id=callagent
rule2.rule2.id=callagent
rule2.param1.target=rule1.param1
rule2.param1.label=Timeout (sec)
rule2.param2.target=rule2.param1
rule2.param2.label=Queue size
rule2.param3.label=Next number
rule2.param4.label=Next number24
ReadPro.java
public class ReadPro {
/**
* @author Bill Zhang
*/
public static void main(String[] args) {
File file = new File("src/pro/rules.properties");
if(file.exists()){
try {
FileInputStream fistream = new FileInputStream(file);
InputStream inStream = new BufferedInputStream(fistream);
Properties pro = new Properties();
try {
pro.load(inStream);
// System.out.println("=============Get Value By rule_id=====================");
// System.out.println(pro.get("rule1.id"));
System.out.println("===========================");
Enumeration<?> enu = pro.propertyNames();
while(enu.hasMoreElements()){
String key = enu.nextElement().toString().trim();
String[] strTemp = key.split("\\."); // "\\" is a convert symbol without it not work in the JDK 6.x
for(int i=0; i<strTemp.length; i++){
if(strTemp[i].equals("id"))
System.out.println(pro.get(key));
}
}
} catch (IOException e) {
System.out.println("+++++++++IOException++++++++");
e.printStackTrace();
}
} catch (FileNotFoundException e) {
System.out.println("++++++++FileNotFoundException+++++++++++");
e.printStackTrace();
}
}else{
System.out.println("File Not Found!");
}
}
}
分享到:
相关推荐
```properties log4j.appender.debug.Threshold=INFO ``` 这段配置指定了名为`debug`的Appender仅输出INFO级别及以上的日志消息。然而,这并不能满足按照不同级别将日志分别输出到独立文件的需求。因为默认情况下,...
标题中的"ReadConfigFile.rar"表明这是一个压缩文件,通常用于存储多个相关文件。在这个场景下,我们可以假设这个压缩包包含了与读取配置文件相关的代码、文档或者示例。配置文件在IT领域中扮演着重要角色,它们存储...
log4j.appender.logfile.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n ``` 在程序启动之前,可以通过`System.setProperty("WORKDIR", "指定路径")`的方式设置该变量的值,比如在Web应用中,可以通过...
LOGGER.info("Champion:read properties failure",e); } 在上面的代码中,我们使用 EncodedResource 指定了 properties 文件的编码方式为 UTF-8,这样可以确保中文字符被正确地加载和处理。 使用 Spring 的 ...
在Spark中,可以通过读取操作(如read、textFile等)读取存储在HDFS、本地文件系统或其他支持的数据源中的数据。 综上所述,这部分内容涵盖了Spark的基本概念、配置文件操作、用户界面定制、代理设置、文件传输设置...
public void saveConfig(Properties properties, Context context, String file) { try { FileOutputStream fos = new FileOutputStream(file); properties.store(fos, "Saved Configurations"); } catch ...
Data Source=C:\\path\\to\\your\\file.xlsx;Extended Properties=\"Excel 12.0 Xml;HDR=YES;\""; OleDbConnection connection = new OleDbConnection(connectionString); connection.Open(); OleDbCommand command ...
File inputFile = new File("a.properties"); File outputFile = new File("b.properties"); // 读取文件为ByteBuffer FileInputStream fis = new FileInputStream(inputFile); FileChannel inChannel = fis....
world = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres')) ax = world.plot(figsize=(10, 6), color='white', edgecolor='black') # 在地图上绘制Shape File gdf.plot(ax=ax, alpha=0.5) plt.show() ...
Console.WriteLine($"文件名: {file.Name}, 大小: {file.Length} 字节"); } ``` 5. **文件属性的注意事项** - 文件操作可能抛出异常,如`FileNotFoundException`(文件不存在)、`UnauthorizedAccessException`...
LogManager.getLogManager().readConfiguration(LoggerUtil.class.getResourceAsStream("logging.properties")); } catch (IOException ex) { Logger.getLogger(LoggerUtil.class.getName()).log(Level.SEVERE, ...
read:该包中的Read_book.java和File_content.java Read_book 主体类,负责界面设计,以及一些基本的监听事件的处理 File_content 处理读取文件内容,通过IO流读取txt文件后对其内容进行处理,如行数num_plus,...
例如,用户交易记录可能需要存储在磁盘上,这时就需要用到File类进行文件操作;或者在通信过程中,可能需要从键盘读取用户输入,这就需要用到Scanner类。此外,序列化机制(如ObjectInputStream和ObjectOutputStream...
24.7. Type-safe Configuration Properties 24.7.1. Third-party Configuration 24.7.2. Relaxed Binding 24.7.3. Merging Complex Types 24.7.4. Properties Conversion Converting durations 24.7.5. @...
var properties = await file.Properties.GetBitmapPropertiesAsync(); properties.SetProperty("System.Photo.Model", "Canon EOS 5D Mark IV"); properties.SetProperty("System.Photo.Manufacturer", "Canon"); ...
`read-configs-from-properties-file`项目是一个示例,展示了如何从属性文件中读取配置,从而实现动态配置和灵活性。这个项目主要关注RESTful API的配置、Spring Boot的自动配置特性以及Java编程语言的运用。 首先...
This sample shows how to create, read, write, copy and delete a file, how to retrieve file properties, and how to track a file or folder so that your app can access it again. This sample uses Windows....
m_lastModifiedTime = m_file.lastModified(); if(m_lastModifiedTime == 0){ System.err.println(PFILE +" file does not exist!"); } m_props = new Properties(); try { m_props.load(new ...
FileUtil.saveFile(file.transferTo(new File("path/to/save"))); ``` **二、多文件上传** 1. **配置** 配置与单文件上传相同。 2. **Controller层** 使用`@RequestPart MultipartFile[] files`接收多个文件...