Differences
This shows you the differences between two versions of the page.
xpcml_util [2013/11/02 20:19] |
xpcml_util [2021/04/05 11:23] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== XPCML Util ====== | ||
+ | This little Java snippet creates a XPCML file from a PCML file. | ||
+ | <sxh java> | ||
+ | import java.io.File; | ||
+ | import java.io.FileInputStream; | ||
+ | import java.io.FileOutputStream; | ||
+ | import java.io.InputStream; | ||
+ | import java.io.OutputStream; | ||
+ | |||
+ | import com.ibm.as400.data.ProgramCallDocument; | ||
+ | |||
+ | public class XPCMLUtil | ||
+ | { | ||
+ | /** | ||
+ | * @param args | ||
+ | */ | ||
+ | public static void main(String[] args) | ||
+ | { | ||
+ | if (args.length == 2) | ||
+ | { | ||
+ | // check if in exists | ||
+ | if (new File(args[0]).exists()) | ||
+ | { | ||
+ | transform(new File(args[0]), | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | private static void transform(File in, File out) | ||
+ | { | ||
+ | try | ||
+ | { | ||
+ | InputStream pcmlStream = new FileInputStream(in); | ||
+ | OutputStream xpcmlStream = new FileOutputStream(out); | ||
+ | ProgramCallDocument.transformPCMLToXPCML(pcmlStream, | ||
+ | } | ||
+ | catch (Exception e) | ||
+ | { | ||
+ | System.err.println(" | ||
+ | e.printStackTrace(); | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | {{tag> |