source: trunk/docx4j/src/main/java/org/docx4j/samples/AbstractSample.java @ 1232

Revision 1232, 573 bytes checked in by jharrop, 20 months ago (diff)

Make it possible to run these samples from the command line.

Line 
1package org.docx4j.samples;
2
3public abstract class AbstractSample {
4       
5        protected static String inputfilepath; 
6        protected static String outputfilepath;
7       
8        protected static void getInputFilePath(String[] args) throws IllegalArgumentException {
9
10                if (args.length==0) throw new IllegalArgumentException("Input file arg missing");
11
12                inputfilepath = args[0];
13        }
14       
15        protected static void getOutputFilePath(String[] args) throws IllegalArgumentException {
16
17                if (args.length<2) throw new IllegalArgumentException("Output file arg missing");
18
19                outputfilepath = args[0];
20        }
21       
22
23}
Note: See TracBrowser for help on using the repository browser.