- Timestamp:
- Mar 13, 2013, 8:00:39 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
AE/installer2/src/net/oni2/aeinstaller/backend/oni/OniSplit.java
r672 r698 33 33 */ 34 34 public static Vector<String> export(File targetFolder, File input) { 35 return export(targetFolder, input, null); 36 } 37 38 /** 39 * Export named resources from given dat-file to target folder 40 * 41 * @param targetFolder 42 * Target folder 43 * @param input 44 * Dat file 45 * @param pattern 46 * Filename pattern for files to export 47 * @return OniSplit output 48 */ 49 public static Vector<String> export(File targetFolder, File input, 50 String pattern) { 35 51 if (!targetFolder.exists()) 36 52 targetFolder.mkdir(); 37 53 38 54 Vector<String> cmdLine = getProgramInvocation(); 39 cmdLine.add("-export"); 55 if (pattern == null) 56 cmdLine.add("-export"); 57 else 58 cmdLine.add("-export:" + pattern); 40 59 cmdLine.add(targetFolder.getPath()); 41 60 cmdLine.add(input.getPath()); … … 134 153 } 135 154 155 /** 156 * Convert given .oni-files to XML and put them in target folder 157 * 158 * @param targetFolder 159 * Target folder 160 * @param inputFiles 161 * .oni files 162 * @return OniSplit output 163 */ 164 public static Vector<String> convertOniToXML(File targetFolder, 165 Vector<File> inputFiles) { 166 if (!targetFolder.exists()) 167 targetFolder.mkdirs(); 168 169 Vector<String> cmdLine = getProgramInvocation(); 170 cmdLine.add("-extract:xml"); 171 cmdLine.add(targetFolder.getPath()); 172 for (File f : inputFiles) { 173 cmdLine.add(f.getPath()); 174 } 175 Vector<String> res = null; 176 try { 177 res = AppExecution.executeAndWait(cmdLine); 178 } catch (IOException e) { 179 e.printStackTrace(); 180 } 181 return res; 182 } 183 184 /** 185 * Convert given XML-files to .oni and put them in target folder 186 * 187 * @param targetFolder 188 * Target folder 189 * @param inputFiles 190 * XML-files 191 * @return OniSplit output 192 */ 193 public static Vector<String> convertXMLtoOni(File targetFolder, 194 Vector<File> inputFiles) { 195 if (!targetFolder.exists()) 196 targetFolder.mkdirs(); 197 198 Vector<String> cmdLine = getProgramInvocation(); 199 cmdLine.add("-create"); 200 cmdLine.add(targetFolder.getPath()); 201 for (File f : inputFiles) { 202 cmdLine.add(f.getPath()); 203 } 204 Vector<String> res = null; 205 try { 206 res = AppExecution.executeAndWait(cmdLine); 207 } catch (IOException e) { 208 e.printStackTrace(); 209 } 210 return res; 211 } 212 136 213 private static String getImportParam() { 137 214 if (Settings.getPlatform() == Platform.MACOS)
Note:
See TracChangeset
for help on using the changeset viewer.