Package net.rim.tumbler.exception

Examples of net.rim.tumbler.exception.PackageException


        File f = new File(archive);
        ZipFile zipFile;

        // check for file's existence
        if (!f.exists()) {
            throw new PackageException("EXCEPTION_WIDGET_ARCHIVE_NOT_FOUND");
        } else {
            try {
                zipFile = new ZipFile(f);
                zipFile.close();
            } catch (Exception e) {
                throw new PackageException("EXCEPTION_ARCHIVE_IO");
            }
        }
    }
View Full Code Here


        try {
            int signingResult = signingProcess.waitFor();

            // Check whether signing is successful
            if (signingResult != 0) {
                throw new PackageException("EXCEPTION_SIGNING_FAILED");
            }

            long newModified = (new File(codFullname)).lastModified();
            if (newModified == lastModified) {
                throw new PackageException("EXCEPTION_SIGNING_FAILED");
            }
        } catch (InterruptedException e) {
            throw e;
        }
    }
View Full Code Here

           
            // parse DOM
            return parseDocument(doc, archive);
           
        } catch (SAXException saxEx) {
            throw new PackageException("EXCEPTION_CONFIGXML_BADXML", saxEx);
        }
    }
View Full Code Here

        //Invalid Configurations.     
       
        //If both source attributes are empty the developer did something wrong.
        if((_widgetConfig.getForegroundSource()==null||_widgetConfig.getForegroundSource().length()==0)&&_widgetConfig.getBackgroundSource()==null) {
            throw new PackageException("EXCEPTION_CONFIGXML_INVALID_CONTENT","Invalid source or souce not specified.");
        }
       
        if(!_widgetConfig.isStartupEnabled()) {
            if(_widgetConfig.getForegroundSource().length()!=0&&_widgetConfig.getBackgroundSource()!=null) {
                throw new PackageException("EXCEPTION_CONFIGXML_INVALID_CONTENT","Invalid source or souce not specified.");
            }
        }
       
        return _widgetConfig;
    }
View Full Code Here

    private void processIconNode(Node iconNode) throws Exception {
        // get icon
        NamedNodeMap attrs = iconNode.getAttributes();
        Node src = attrs.getNamedItem("src");
        if (src == null) {
            throw new PackageException("EXCEPTION_CONFIGXML_INVALID_ICON");
        }
        String iconSrc = getURIValue(src);
       
        // check hover
        Node hoverAttr = attrs.getNamedItem("rim:hover");
View Full Code Here

    /*
     * Processes the loading screen node and sets Loading Screen configurations
     */
    private void processLoadingScreenNode(Node loadingScreenNode) throws Exception {
        if (loadingScreenNode.getNodeType() != Node.ELEMENT_NODE) {
            throw new PackageException("EXCEPTION_CONFIGXML_INVALID_LOADINGSCREEN_ELEMENT");
        }      
       
        NamedNodeMap attrs = loadingScreenNode.getAttributes();
        Node attr;
       
        attr = attrs.getNamedItem("backgroundColor");
        if (attr != null) {
            _widgetConfig.setLoadingScreenColour(getTextValue(attr));
        }

        attr = attrs.getNamedItem("backgroundImage");
        if (attr != null) {
            _widgetConfig.setBackgroundImage(getTextValue(attr).replace('\\', '/').trim());
        }
       
        attr = attrs.getNamedItem("foregroundImage");
        if (attr != null) {
            _widgetConfig.setForegroundImage(getTextValue(attr).replace('\\', '/').trim());
        }

        attr = attrs.getNamedItem("onFirstLaunch");
        if (attr != null && attr.getNodeValue().equalsIgnoreCase("true")) {
            _widgetConfig.setFirstPageLoad(true);
        }
   
        attr = attrs.getNamedItem("onRemotePageLoad");
        if (attr != null && attr.getNodeValue().equalsIgnoreCase("true")) {
            _widgetConfig.setRemotePageLoad(true);
        }

        attr = attrs.getNamedItem("onLocalPageLoad");
        if (attr != null && attr.getNodeValue().equalsIgnoreCase("true")) {
            _widgetConfig.setLocalPageLoad(true);
        }
       
        Element loadingScreenElement = (Element) loadingScreenNode;

        // Process nested <rim:transitionEffect> elements
        NodeList transitionEffectList = loadingScreenElement.getElementsByTagName("rim:transitionEffect");
        if (transitionEffectList.getLength() > 1) {
            throw new PackageException("EXCEPTION_CONFIGXML_INVALID_LOADINGSCREEN_ELEMENT");
        }

        if (transitionEffectList.getLength() > 0) {
            Node transitionEffectNode = transitionEffectList.item(0);
            processTransitionEffectNode(transitionEffectNode);
View Full Code Here

     */
    private void processConnectionNode(Node connectionNode) throws Exception {

        // This should be an element node
        if (connectionNode.getNodeType() != Node.ELEMENT_NODE) {
            throw new PackageException("EXCEPTION_CONFIGXML_INVALID_CONNECTION_ELEMENT");
        }
        Element connElement = (Element) connectionNode;

        // Process timeout attribute
        NamedNodeMap attrs = connElement.getAttributes();
View Full Code Here

                if (!(new File(debugToken).isFile())) {
                    //
                    // It is an error for the <debug_token> element to
                    // contain a pathname that does not point to a file.
                    //
                    throw new PackageException(EXCEPTION_DEBUG_TOKEN_INVALID);
                } else {
                    cmd = new String[] {
                        _airPackagerPath,
                        FLAG_PACKAGE,
                        FLAG_DEV_MODE,
                        FLAG_DEBUG_TOKEN,
                        debugToken,
                        FLAG_TARGET,
                        SessionManager.getInstance().debugModeInternal() ? PATH_BAR_DEBUG : FILE_EXT_BAR,
                        FLAG_BUILDID,
                        buildId,
                        outputPath
                    };
                }
            }
            int n = files.length;
            String[] join = new String[cmd.length + n];
            System.arraycopy(cmd, 0, join, 0, cmd.length);
            System.arraycopy(files, 0, join, cmd.length, n);
            Process p = buildProcess(join, new File(bindebugPath));

            OutputBuffer stdout = new OutputBuffer(p);
            ErrorBuffer stderr = new ErrorBuffer(p);
            ExitBuffer exitcode = new ExitBuffer(p);

            stdout.waitFor();
            stderr.waitFor();
            exitcode.waitFor();

            if (exitcode.getExitValue().intValue() != 0) {
                System.out.write(stderr.getStderr());
                System.out.write(stdout.getStdout());
                System.out.flush();
                return exitcode.getExitValue().intValue();
            }
        } catch (IOException ioe) {
          ioe.printStackTrace();
            throw new PackageException(EXCEPTION_AIRPACKAGER);
        } catch (InterruptedException ie) {
            throw new PackageException(EXCEPTION_AIRPACKAGER);         
        }
        return 0;
    }
View Full Code Here

         
          for (String id : dependencies) {
            if (!_inProgressStack.contains(id)) {
              deps.add(id);
            } else {
              throw new PackageException("EXCEPTION_CIRCULAR_DEPENDENCY", id);
            }
          }
         
          resolve(deps);
        }
       
        _inProgressStack.pop();
      } else {
        throw new PackageException("EXCEPTION_EXTENSION_NOT_FOUND", extId);
      }     
    }
  }
View Full Code Here

        try {
            TemplateWrapper templateWrapper = new TemplateWrapper(_bbwpProperties);
            _outputFiles.addAll(templateWrapper.writeAllTemplates(
                    SessionManager.getInstance().getSourceFolder()));
        } catch (IOException ex) {
            throw new PackageException("EXCEPTION_IO_TEMPLATES");
        }
       
        // extract archive
        ZipFile zip = new ZipFile(new File(SessionManager.getInstance().getWidgetArchive()).getAbsolutePath());
        Enumeration<?> en = zip.entries();
View Full Code Here

TOP

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

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.