218,224c218,222
<         if (StringUtils.contains(pathPart, "_")) {
<             try {
<                 return Long.parseLong(StringUtils.substringBefore(pathPart, "_"));
<             } catch (NumberFormatException e) {
<                 // ignore
<             }
<         }
---
>         Pattern regex = Pattern.compile("^[0-9]+");
>         Matcher m = regex.matcher(pathPart);
>         if (m.find()) {
>             return Long.valueOf(m.group());
>         }
