public static long longFromProperties(Properties p,String propName,long defaultValue){
  long ret=defaultValue;
  String longString=p.getProperty(propName);
  if (longString != null) {
    try {
      ret=Long.parseLong(longString.trim());
    }
 catch (    NumberFormatException e) {
      ret=defaultValue;
    }
  }
  return ret;
}

public static long longFromProperties ( Properties p , String propName , long defaultValue ) { long ret = defaultValue ; String longString = p . getProperty ( propName ) ; if ( longString != null ) { try { ret = Long . parseLong ( longString . trim ( ) ) ; } catch ( NumberFormatException e ) { ret = defaultValue ; } } return ret ; }
gets a long out of a properties object . returns the default value if something goes wrong .
