Thank you Martin;
I know what you said; but dos2unix is for me a no go as our users do not have Cygwin installed (company policy). Meanwhile I have mastered my problem and developed 3 Output Stream classes CRLFOutputStream LFOutputStream CROutputStream any combinations of CRLF, LF, or CR when read from an Input Stream is thereafter converted into what the class name mentions when the Output Stream object belongs to one of the classes above. This works nice and on the fly for me; Now I will try and write my own Data Handler to control what we are using when we write output; i.e. a binary content must pass every bit as normal; os.writeTo(fso) and a .PAS on DOS must convert to LF when written to OpenVMS; Later I go to write my stream which convert my Stream_LF data when it arrives at the server into variable length record files when textual content is passed to OpenVMS. Logs are often of RFM type VFC (Variable Length with Fix Controlstructure) and a RFM VAR type has a 2 byte counter up-from telling how long the record is to the next counter byte pair; Converting to/from VAR and VFC to/from Stream_LF for some of the well know OpenVMS file types is what I want. The rest can pass as binary which works perfect with MTOM. Josef Von: Martin Gainty [mailto:mgai...@hotmail.com] Gesendet: Donnerstag, 6. Juni 2013 12:24 An: java-user@axis.apache.org Betreff: RE: [axis2-mtom] how to deal with line endings among platforms Josef Josef convert DOS files to UNIX dos2unix (comes with cygwin) http://www.cygwin.com/ If you are processing images.. any reason why FileOutputStream is a better handler than FileImageOutputStream http://docs.oracle.com/javase/6/docs/api/javax/imageio/stream/FileImageO utputStream.html if (f.exists() && f.canWrite()) { f.delete(); } else { //use the existing file handle before writing it out.. //you will have to know the exact length of the file before writing it out } ? Martin ______________________________________________ Verzicht und Vertraulichkeitanmerkung Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. ________________________________ Subject: [axis2-mtom] how to deal with line endings among platforms Date: Thu, 6 Jun 2013 11:01:15 +0200 From: josef.stadelm...@axa-winterthur.ch To: axis-u...@ws.apache.org Hi all, I have a web service client realized in C#.NET WCF and a Axis2-1-6-1 MTOM web service with a up- and download method. It works perfect and byte transparent as long as I transfer binaries such as Word Document, Excel Spread Sheets .docx, doc, .xslx, xls, xlsm, bmp, jpeg, etc. files. Now I have to move .PAS files from my server to the client on a PC for development and that's where I need your recommendations On the OpenVMS Server a .PAS file is saved with the following file attributes RFM:VAR, RAT:CR saying the record format RFM is variable and the record attribute RAT is carriage return controlled. The RFM:VAR says that each record does not need a LF or CR or CRLF to terminate the line BUT but the record starts with a two byte character count telling how many ISO-LATIN1 characters are in the record. I know that all JAVA used Stream_LF only, I can use that as well to edit by i.e. EDT on the Server; However each time someone edits such a file on a PC, by default Windows/DOS appends CRLF to the end of the line, and just moving such a file now with MTOM to the server makes the PASCAL compiler complaining about an illegal character at the end of the line which is the CR, while the LF is considered by the PASCAL compiler. My question is now; How can I, best at the server, convert this CRLF to a LF only, or even better to a VAR file, by adding a short to the begin of the record and remove the DOS CRLF line termination. Is there a possibility to configure my service client or server side to replace each CRLF with a LF i.e. when a certain fikle extension is seen i.e. ".PAS, .TXT" The issue is that MTOM delivers to the service an ImageDepot which is a DataHandler which provides stream of bytes, which I processes as all my binaries like private void processImageDepot(ImageDepot data, String fname, String owner, String protection) throws Exception, IOException, InterruptedException { DataHandler dh = data.getImageData(); if (dh != null) { File f = new File(fname); if (f.exists() && f.canWrite()) { f.delete(); } FileOutputStream fos = new FileOutputStream(f); dh.writeTo(fos); fos.flush(); fos.close(); // post processing to correct file-attributes, -owner and -protection if ("OpenVMS".equalsIgnoreCase(this.OperatingSystem)) { Process pid; String[][] args = { {"/sys$login/test.com", f.getPath(), owner, protection} {"/sys$login/compile.com", f.getPath(), "/DEBUG/NOOPTIMIZE"} }; for (int j = 0; j < args.length; j++) { // j goes over command lines for (int i = 0; i < args[j].length; i++) { // i goers over aguments in command line log.info("args[" + j + "][" + i + "] " + args[j][i]); } try { pid = Runtime.getRuntime().exec(args[j]); pid.waitFor(); } catch (IllegalArgumentException e) { log.error("Don't know how to activate son"); log.error(e.getMessage(), e); } } } } else { log.error(">> [ERROR] - ImageDepot was not null, but did not contain binary data"); }