If you required only for file write, you can use below code.
FileOutputStream OutputStream fout = null;
String successFlag = “false”;
try {
FileOutputStream OutputStream fout = null;
// Check to see if the overwriteFlag was set to overwrite
if (strOverwriteFlag.equals(“overwrite”)) {
//Create a new FileOutputStream object that will overwrite the old file
fout = new FileOutputStream(strFilename, false);
}
else { // append for all other values
//Create a new FileOutputStream object that will append to the old file
fout = new FileOutputStream(strFilename, true);
}
OutputStream bout= new BufferedOutputStream(fout);
OutputStreamWriter out = new OutputStreamWriter(bout, strCharset);
out.write(strFileContent);
out.flush();
out.close();
//Set the success flag because the service was successful
successFlag = “true”;
}
catch (Exception e) {
//Set the success flag because the service failed
successFlag = “false”;
}
#webMethods#Integration-Server-and-ESB#Flow-and-Java-services