1 | ModuleXmlBean module = new ModuleXmlBean();↵ | | |
|
2 | module.setName(f.getName());↵ | | |
|
3 | for (File a : f.listFiles()) {↵ | | |
|
|
4 | String filename = a.getName();↵ | | |
|
5 | System.out.println("Processing artifact file: " + filename);↵ | | |
|
6 | String type = filename.substring(filename.indexOf(".") + 1);↵ | | |
|
7 | ArtifactXmlBean artifact = new ArtifactXmlBean();↵ | | |
|
8 | artifact.setName(a.getName());↵ | | |
|
9 | artifact.setType(type);↵ | | |
|
10 | artifact.setVersion(version);↵ | | |
|
11 | artifact.setSize(a.length());↵ | | |
|
12 | artifact.setChecksum(_iou.getCheckSum(a));↵ | | |
|
13 | module.addArtifact(artifact);↵ | | |
|
14 | ↵ | | 1 | try↵
|
| | | 2 | {↵
|
| | | 3 | pack.mkdirs();↵
|
|
| | | 4 | FileWriter fw = new FileWriter(javaFile);↵
|
| | | 5 | PrintWriter pw = new PrintWriter(fw);↵
|
|
| | | 6 | pw.println(CODE);↵
|
|
| | | 7 | pw.flush();↵
|
| | | 8 | fw.flush();↵
|
| | | 9 | pw.close();↵
|
| | | 10 | fw.close();↵
|
|
| | | 11 | // i18n[FactoryProviderController.fileCreated=File {0} has been successfully created.]↵
|
| | | 12 | _plugin.getApplication().getMessageHandler().showMessage(s_stringMgr.getString("FactoryProviderController.fileCreated", javaFile));↵
|
| | | 13 | }↵
|
| | | 14 | catch (Exception e)↵
|
| | | 15 | {↵
|
| | | 16 | // i18n[FactoryProviderController.fileCreateFailed=File {0} could not be created: {1}]↵
|
| | | 17 | String msg = s_stringMgr.getString("FactoryProviderController.fileCreateFailed", new Object[]{javaFile, e});↵
|
| | | 18 | _plugin.getApplication().getMessageHandler().showErrorMessage(msg);↵
|
| | | 19 | s_log.error(msg, e);↵
|
15 | } | | 20 | }
|