本文整理了Java中com.ebmwebsourcing.petalsbpm.utils.server.ZipHelper.unzipFile()
方法的一些代码示例,展示了ZipHelper.unzipFile()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipHelper.unzipFile()
方法的具体详情如下:
包路径:com.ebmwebsourcing.petalsbpm.utils.server.ZipHelper
类名称:ZipHelper
方法名:unzipFile
暂无
代码示例来源:origin: com.ebmwebsourcing.petalsbpm/bpmn-plugins
private void readZipFile(File file) throws Exception {
File unzipDir = BPMNFileHelper.getOrCreateUnzipDirectory(file);
ZipHelper.getInstance().unzipFile(file,unzipDir);
//Read the bpmn definitions and diagram from the files and fill the instance
readBPMNFiles(unzipDir.listFiles());
//copy the possible attached files into the proper directory
File attachedFilesDir = WebEditorService.getInstance().getAttachedFilesDirectory(UserServiceImpl.getInstance().getLoggedUser(), instance);
File bpmnFile = BPMNFileHelper.getBPMNFileInList(unzipDir.listFiles());
File importedAttachmentsFile = new File(unzipDir,WebEditorService.ATTACHMENTS_DIR);
if(importedAttachmentsFile.exists()) {
for(File f : importedAttachmentsFile.listFiles()) {
FileHelper.copyFile(f, attachedFilesDir);
}
}
//normally it is not executed if the files were produced by the editor
for(File f : unzipDir.listFiles()) {
if(!f.equals(bpmnFile) && !f.equals(importedAttachmentsFile)) {
FileHelper.copyFile(f, attachedFilesDir);
}
}
}
代码示例来源:origin: com.ebmwebsourcing.petalsbpm/bpmn-plugins
private File getXPDLFromBPMN2(File projectInstanceFile, File temporaryOutputDirectory) throws Exception{
XPDLAdapter adapter = new XPDLAdapter();
if(ZipHelper.getInstance().isZipFile(projectInstanceFile)) {
ZipHelper.getInstance().unzipFile(projectInstanceFile, temporaryOutputDirectory);
return adapter.getXPDL2FromBPMN2(BPMNFileHelper.getBPMNFileInFolder(temporaryOutputDirectory).getAbsolutePath());
}
else {
return adapter.getXPDL2FromBPMN2(projectInstanceFile.getAbsolutePath());
}
}
代码示例来源:origin: com.ebmwebsourcing.petalsbpm/bpmn-plugins
private File getMetaDataFromZip(File zipFile, IProjectInstanceFormat format) throws ZipException, IOException {
File unzipDir = BPMNFileHelper.getOrCreateUnzipDirectory(zipFile);
ZipHelper.getInstance().unzipFile(zipFile, unzipDir);
File attachedFilesDir = WebEditorService.getInstance().getAttachedFilesDirectory(UserServiceImpl.getInstance().getLoggedUser(),ProjectServiceImpl.getInstance().getCurrentProjectInstance());
File bpmnFile = BPMNFileHelper.getBPMNFileInList(unzipDir.listFiles());
for(File f : unzipDir.listFiles()) {
FileHelper.copyFile(f, attachedFilesDir);
}
return bpmnFile;
}
代码示例来源:origin: com.ebmwebsourcing.petalsbpm/bpmn-plugins
private File getBPELZipFromBPMN(File projectInstanceFile, IProjectInstanceMetaData exportData, File directory) throws Exception{
FileHelper.cleanDirectory(directory);
//first retrieve the bpmn defintions form the given project instance file
if(ZipHelper.getInstance().isZipFile(projectInstanceFile)) {
ZipHelper.getInstance().unzipFile(projectInstanceFile,directory);
}
else {
FileHelper.copyFile(projectInstanceFile, directory);
}
File bpmnFile = BPMNFileHelper.getBPMNFileInFolder(directory);
URL url = bpmnFile.toURI().toURL();
Definitions defs = new XmlContextFactory().newContext().createReader().readDocument(url, Definitions.class);
//get or create a temp dir and generate bpel and wsdl files in it
String bpelZipPath = directory.getAbsolutePath()+File.separator+"zip";
File bpelZipDir = new File(bpelZipPath);
if(!bpelZipDir.exists()) {
bpelZipDir.mkdir();
}
FileHelper.cleanDirectory(bpelZipDir);
new BPELGenerator().generate(defs, bpelZipPath);
//make a zip out of this temporary directory
return ZipHelper.getInstance().createZipFromFolder(bpelZipPath, directory.getAbsolutePath()+File.separator+"BPEL"+defs.getId()+".zip");
}
代码示例来源:origin: com.ebmwebsourcing.petalsbpm/bpmn-deployer
if(ZipHelper.getInstance().isZipFile(bpmnFile)) {
File zipDir = FileHelper.createTemporaryDirectory();
ZipHelper.getInstance().unzipFile(bpmnFile, zipDir);
for(File f : zipDir.listFiles()){
if((f.getName().startsWith("BPMN_") && f.getName().endsWith(".xml"))
内容来源于网络,如有侵权,请联系作者删除!