on 07-14-2009 10:52 AM
Hi evrybody,
how to I have to modify my main method, taht the outputstream is written to my disc?
// the following is in the main[] method
ByteArrayOutputStream os = new ByteArrayOutputStream();
try {
// main[] calls execute
new myJAVAMapping().execute((InputStream) is, os);
} catch (Exception e) {
e.printStackTrace();
}
// here I want to write the ByteArrayOutputStream to disc.
???
Thx regards Mario
solved on my own.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mulelr,
in order to test your java mapping as a standalone application, you need usee input and output streams for reading and writing files from and to the local disk.
the code may look like the below one:
public static void main(String[] args) {
try {
File file = new File("d:/in.xml");
System.out.println("" + file.getAbsolutePath());
InputStream in = new FileInputStream(file);
OutputStream out = new FileOutputStream(new File("d:/output.xml"));
MappingEX myMapping = new MappingEX();
myMapping.execute(in, out);
} catch (Exception e) {
e.printStackTrace();
}
}
in the given code "MappingEX" is the Class name of your mapping program. As well for input and out put stream you can specify the location where u want read from and write to.
Regards
Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mulelr,
If you want test you java mapping locally for that you have to write main method in JAVA Mapping,
add below code
public static void main(String[] args) {
try {
Classname fec = new ClassName();
FileInputStream in =
new FileInputStream("C:");
OutputStream out = new ByteArrayOutputStream();
fec.execute(in, out);
} catch (Exception e) {
System.out.println(e);
}
}
Classname means give your javamapping class name here.
Then if you want to see the out put.
using System.out.println method printh the out pust stream.
Regards,
Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.