public Long convertStringToLong(final String urlParameter, final boolean required) throws UrlParameterException {
        Long parameterValue = null;
        if (urlParameter == null) {
            if (required) {
                throw new UrlParameterException("Parameter should be present");
            }
        } else {
            try {
                parameterValue = Long.parseLong(urlParameter);
            } catch (NumberFormatException e) {
                throw new UrlParameterException("Wrong Long parameter", e);
            }
        }

        return parameterValue;
    }