zoukankan      html  css  js  c++  java
  • java Properties (属性集)

     加载Properties

    Properties downloadLog = new Properties();
    try {
                       //加载logFile文件
                downloadLog.load(new FileReader(logFile));
            } catch (IOException e) {
                e.printStackTrace();
            }

     设置和读取属性

    final String uri = httpServletRequest.getRequestURI();
    String property = downloadLog.getProperty(uri); if (property == null) { downloadLog.setProperty(uri, "1"); } else { int count = 0; try { count = Integer.parseInt(property); } catch (NumberFormatException e) { // silent } count++; downloadLog.setProperty(uri, Integer.toString(count)); }
  • 相关阅读:
    Android随笔
    Android随笔
    阅读笔记
    Android随笔
    Android随笔
    Android随笔
    Android随笔
    Java随笔
    Android随笔
    NC20265 着色方案(dp)
  • 原文地址:https://www.cnblogs.com/jiangfeilong/p/10716400.html
Copyright © 2011-2022 走看看