Here you can find the source of getIntProperty(Properties props, String keyword, int defaultValue)
public static int getIntProperty(Properties props, String keyword, int defaultValue)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static int getIntProperty(Properties props, String keyword, int defaultValue) { int rv = defaultValue; if (props != null) { String s = props.getProperty(keyword); if (s != null) { s = s.trim();/*from ww w . jav a 2s.c om*/ if (!s.isEmpty()) { try { rv = Integer.parseInt(s); } catch (NumberFormatException ex) { } } } } return rv; } public static String getProperty(Properties props, String keyword) { String rv = null; if (props != null) { rv = props.getProperty(keyword); } if (rv != null) { if (rv.trim().isEmpty()) { rv = ""; } } else { rv = ""; } return rv; } public static int parseInt(String text, int minValue, int defaultValue) { int value = defaultValue; if (text != null) { try { value = Integer.parseInt(text); } catch (NumberFormatException ex) { } } return value >= minValue ? value : minValue; } }