Code example for ZipInputStream

Methods: close

0
                log.debug("Not a process archive");
                return "Not a process archive"; 
            } 
            try { 
                log.debug("Deploying process archive " + fileItem.getName());
                ZipInputStream zipInputStream = new ZipInputStream(fileItem.getInputStream());
                JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext();
                log.debug("Preparing to parse process archive");
                ProcessDefinition processDefinition = ProcessDefinition.parseParZipInputStream(zipInputStream);
                log.debug("Created a processdefinition : " + processDefinition.getName());
                jbpmContext.deployProcessDefinition(processDefinition);
                zipInputStream.close();
                return "Deployed archive " + processDefinition.getName() + " successfully";
            } catch (IOException e) {
                log.debug("Failed to read process archive", e);
                return "IOException"; 
            } 
        } catch (FileUploadException e) {
            log.debug("Failed to parse HTTP request", e);
            return "FileUploadException"; 
        }