gpt4 book ai didi

com.ebmwebsourcing.petalsbpm.utils.server.ZipHelper.getInstance()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 06:48:31 26 4
gpt4 key购买 nike

本文整理了Java中com.ebmwebsourcing.petalsbpm.utils.server.ZipHelper.getInstance()方法的一些代码示例,展示了ZipHelper.getInstance()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipHelper.getInstance()方法的具体详情如下:
包路径:com.ebmwebsourcing.petalsbpm.utils.server.ZipHelper
类名称:ZipHelper
方法名:getInstance

ZipHelper.getInstance介绍

暂无

代码示例

代码示例来源: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

protected void readFile(File file) throws Exception {
  if(ZipHelper.getInstance().isZipFile(file)) {
    readZipFile(file);
  }
  else {
    readBPMNFiles(new File[]{file});
  }
}

代码示例来源: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 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-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-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"))

代码示例来源:origin: com.ebmwebsourcing.petalsbpm/bpmn-plugins

if(importFiles!=null && importFiles.length>0) {
  FileHelper.copyFile(attachedFilesDir, zipDir);
  File zipFile = ZipHelper.getInstance().createZipFromFolder(path,directory+File.separator+defs.getId()+".zip");
  return zipFile;

代码示例来源:origin: com.ebmwebsourcing.petalsbpm/bpmn-plugins

if(ZipHelper.getInstance().isZipFile(file)) {
  bpmnFile = getMetaDataFromZip(file, format);

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com