Package net.rim.tumbler.exception

Examples of net.rim.tumbler.exception.ValidationException


    public Vector<String> getIconSrc() throws ValidationException {
        if (_iconSrc.toString().length() > 2
                && !(_iconSrc.firstElement().toString().startsWith(FILE_EXT_L_ICON) || _iconSrc.firstElement().toString().startsWith(FILE_EXT_U_ICON))
                && !(_iconSrc.firstElement().toString().toLowerCase().endsWith(FILE_EXT_L_PNG))){
            throw new ValidationException(
                    EXCEPTION_INVALID_ICON_FILE_TYPE);
        }
        return _iconSrc;
    }
View Full Code Here


        _author = author;
    }

    public void setName(String name) throws ValidationException {
        if (name == null || name.length() == 0) {
            throw new ValidationException(
                    EXCEPTION_CONFIGXML_MISSING_WIDGET_NAME);
        }
        _name = name;
    }
View Full Code Here

        // version="a.b.c"
        // version="a.b.c.d"
        Matcher matcher = VERSION_PATTERN.matcher(version);

        if (!matcher.matches()) {
            throw new ValidationException(EXCEPTION_CONFIGXML_INVALID_VERSION);
        }
        setVersionParts(parseVersion(matcher));
    }
View Full Code Here

            // color variable should look like: #000000
            String regex = REGEX_COLOR;
            Pattern pattern = Pattern.compile(regex);
            Matcher matcher = pattern.matcher(screenColour);
            if (!matcher.matches()) {
                throw new ValidationException(
                        EXCEPTION_CONFIGXML_LOADINGSCREEN_COLOUR);
            }
        }
       
        _loadingScreenColour = screenColour;
View Full Code Here

    }
   
    private void validate() throws Exception {
        // Check template and archive
        if (!(new File(_templateDir)).exists()) {
            throw new ValidationException("EXCEPTION_TEMPLATES_NOT_FOUND");
        }
       
        if (!(new File(_airTemplate)).exists()) {
            throw new ValidationException("EXCEPTION_TEMPLATES_NOT_FOUND");
        }
        if (!SessionManager.getInstance().isPlayBook()) {
            if (_rapc.length() == 0 ) {
                throw new ValidationException("EXCEPTION_RAPC_NOT_FOUND");
            } else {        
                if (!_rapc.equals("rapc.exe") && !_rapc.equals("rapc")) {
                    if (!(new File(_rapc)).exists()) {
                        throw new ValidationException("EXCEPTION_RAPC_NOT_FOUND");
                    }
                }
            }
            
            // Check javac path
            if (_javac == null || _javac.length() == 0 ) {
                // For tooling, they will set _javac to empty if they find javac.exe in "Path" environment variable 
                // Rapc doesn't depend on this value to locate javac.exe, either
                //throw new ValidationException("EXCEPTION_JAVAC_NOT_FOUND");
            } else {        
                if (!_javac.equals("javac.exe") && !_javac.equals("javac")) {
                    String javac = _javac; 
                    
                    if (javac.startsWith("\"") && javac.endsWith("\"")) {
                        javac = javac.substring(1, javac.length() - 1);
                    }
                    
                    if (!(new File(javac)).exists()) {
                        throw new ValidationException("EXCEPTION_JAVAC_NOT_FOUND");
                    }
                }
            }
        }
        // Tablet SDK path should be absolute and existing
        if ((new File(_tabletSDK).isAbsolute()) && (new File(_tabletSDK)).exists()) {
        } else {
            throw new ValidationException("EXCEPTION_TABLET_SDK_NOT_FOUND");
        }
    }
View Full Code Here

        try {
            _uri = URI.create(uri);
            // check for a protocol - mks354080
            if (!(_uri.toString().equals("WidgetConfig.WIDGET_LOCAL_DOMAIN")) &&
                    (_uri.getScheme() == null || _uri.getScheme().length() == 0)) {
                throw new ValidationException (
                        "EXCEPTION_ACCESSURI_NO_PROTOCOL", uri.toString());
            }
            _allowSubDomain = allowSubDomain;
           
            String host = _uri.getHost();
            if (host != null
                    && SessionManager.getInstance().getTLD().indexOf(
                            "$$" + host.toLowerCase().trim() + "$$") != -1 && _allowSubDomain) {
                // throw exception - exit compilation
                throw new ValidationException( "EXCEPTION_CONFIGXML_TLD", uri );
            }
        } catch (IllegalArgumentException e) {
            throw new ValidationException("EXCEPTION_ACCESSURI_BADURI", uri.toString());
        }
    }
View Full Code Here

        if (!isPlayBook()) {
            String keyPath = _bbwpJarFolder + WidgetPackager.SIGNATURE_KEY_FILE;

            // check for file's existence
            if (!(new File(keyPath)).exists()) {
                throw new ValidationException("EXCEPTION_MISSING_SIGNING_KEYS");
            }
        } else if (!SigningSupport.isSigningKeyPresent(_bbwpJarFolder)) {
            throw new ValidationException("EXCEPTION_MISSING_SIGNING_KEYS");
        }
    }
View Full Code Here

        }
       
        // validate that a widget name/author was specified
        if (_widgetConfig.getName() == null) {
            //exception
            throw new ValidationException("EXCEPTION_CONFIGXML_MISSING_WIDGET_NAME");
        }
       
        // validation via logging
        if (_widgetConfig.getAuthor() == null) {
            // just log warning
View Full Code Here

                    }
                } else {
                    _widgetConfig.setMultiAccess(true);
                    // no features allowed for *
                    if (getFeatureListFromNode(node).size() > 0) {
                        throw new ValidationException("EXCEPTION_CONFIGXML_FEATURES_NOT_ALLOWED");
                    }
                }
            }
        }
        if (!hasFeatures) {
View Full Code Here

                        WidgetFeature wf = new WidgetFeature(name, isRequired,
                                version, null);
                        featureList.addElement(wf);
                    }
                } else {
                    throw new ValidationException("VALIDATION_MISSING_FEATURE_ID");
                }
            }
        }

        return featureList;
View Full Code Here

TOP

Related Classes of net.rim.tumbler.exception.ValidationException

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.