Package com.volantis.map.common.param

Examples of com.volantis.map.common.param.ParameterBuilderException


                    }
                }
            }
           
        } catch (Exception e) {
            throw new ParameterBuilderException(e);
        }
    }
View Full Code Here


            } else {
                result = getRemoteImage(srcURL, retriever, request);
            }

            if (result == null) {
                throw new ParameterBuilderException("Can't load input image");
            }

            //determine input image MIME type.
            String type = result.getFileType();
            params.setParameterValue(ParameterNames.SOURCE_IMAGE_MIME_TYPE, type);
View Full Code Here

                    LOGGER.debug("config-loaded");
                }

            } catch (Throwable e) {
                LOGGER.error("config-loading-error");
                throw new ParameterBuilderException(e);
            } finally {
                // is != null because we are inside the if
                try {
                    is.close();
                } catch (IOException e) { /* ignore */ }
View Full Code Here

                break;
            case 16:
                param = ParameterNames.DITHER_MODE_16_BIT;
                break;
            default:
                throw new ParameterBuilderException(
                        EXCEPTION_LOCALIZER.format(
                                "dither-bit-depth-not-supported",
                                new String[] {String.valueOf(bitDepth),
                                              mode.toString()}));
View Full Code Here

     * @throws ParameterBuilderException if an error occurs
     */
    private void setImageWidth(int width, MutableParameters params)
            throws ParameterBuilderException {
        if (width < -1) {
            throw new ParameterBuilderException("Invalid image width '" +
                                                width +
                                                "'. Value must be >= -1");
        }
        if (!params.containsName(ParameterNames.IMAGE_WIDTH)) {
            setIntParam(ParameterNames.IMAGE_WIDTH, width, params);
View Full Code Here

     * @throws ParameterBuilderException if an error occurs
     */
    private void setMaxImageSize(int size, MutableParameters params)
            throws ParameterBuilderException {
        if (size < -1) {
            throw new ParameterBuilderException("Invalid max image size '" +
                                                size +
                                                "'. Value must be >= -1");
        }
        if (!params.containsName(ParameterNames.MAX_IMAGE_SIZE)) {
            setIntParam(ParameterNames.MAX_IMAGE_SIZE, size, params);
View Full Code Here

            throws ParameterBuilderException {

        Path requestPath = Path.parse(request.getPath());
        String rule = getRule(requestPath);
        if (rule == null || "".equals(rule)) {
            throw new ParameterBuilderException(
                    EXCEPTION_LOCALIZER.format("conversion-rule-not-set",
                                               request.toString()));
        }
        setStringParam(ParameterNames.DESTINATION_FORMAT_RULE, rule, params);
View Full Code Here

    private static Path removeRuleFromRequest(Path requestPath)
            throws ParameterBuilderException {

        int fragments = requestPath.getNumberOfFragments();
        if (fragments < 2) {
            throw new ParameterBuilderException(EXCEPTION_LOCALIZER.format("invalid-request", requestPath));
        }
        Path p1 = new Path(requestPath, 0, fragments - 2);
        String name = requestPath.getFragment(fragments - 1);
        p1 = p1.resolve(name);
        return p1;
View Full Code Here

    private static String getRule(Path requestPath)
        throws ParameterBuilderException {

        int fragments = requestPath.getNumberOfFragments();
        if (fragments < 2) {
            throw new ParameterBuilderException(
                EXCEPTION_LOCALIZER.format("invalid-request", requestPath));
        }

        return requestPath.getFragment(fragments - 2);
    }
View Full Code Here

TOP

Related Classes of com.volantis.map.common.param.ParameterBuilderException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.