}
return retVal;
}
private Bounds getBounds(int pdfNumberOfPages, String currentPageSelection) throws ConcatException {
Bounds retVal = new Bounds(1, pdfNumberOfPages);
if (!(ValidationUtility.ALL_STRING.equals(currentPageSelection))) {
String[] limits = currentPageSelection.split("-");
try {
retVal.setStart(Integer.parseInt(limits[0]));
// if there's an end limit
if (limits.length > 1) {
retVal.setEnd(Integer.parseInt(limits[1]));
} else {
// difference between '4' and '4-'
if (currentPageSelection.indexOf('-') == -1) {
retVal.setEnd(Integer.parseInt(limits[0]));
} else {
retVal.setEnd(pdfNumberOfPages);
}
}
} catch (NumberFormatException nfe) {
throw new ConcatException(ConcatException.ERR_SYNTAX, new String[] { "" + currentPageSelection }, nfe);
}