In a nutshell i'm working with a program that uses JSCH and xstream to zip a file, and send it to a remote linux server. I'm using static folders, but when i send a file with the same name as one in the folder it will overwrite the exhisting file. I don't want this to happen. I can run pre and post scripts before and after the file is sent. How can i eliminate this, i was thinking returning a file with the list of files using ls and somehow storing that in a file. I'm curious of how someone …

Member Avatar
Member Avatar
+0 forum 5

I am trying to make a form using html and JSP, get the data and save them in an XML file. I use also Tomcat 1.6 as server. For generating the XML I am using the XStream library. I have a Customer.java class with get and set methods for a message and an email. Then I have a GenerateXml.java file which creates a Customer object, get the data and add them in an XML file: [code=Java]Customer customer = new Customer(); customer.getMessage(); customer.getEmail(); XStream xs = new XStream(); try { FileOutputStream fs = new FileOutputStream("C:\\customers.txt"); xs.toXML(customer, fs); } catch (FileNotFoundException e1) …

Member Avatar
Member Avatar
+0 forum 1

I am trying to serialize a List which looks as follows: [Code] public class Comp { public enum TYPE { Type1, Type2, Type3 }; public Type type; [/Code] So, I create a list of these like this: [Code] Comp a = new Comp(); a.type = Type.Type1; Comp b = new Comp(); b.type = Type.Type2; List<Comp> list = new List<Comp>(); list.add(a); list.add(b); xstream.toXML(list); [/Code] The problem is that this does not convert the enum Type in the resulting XML, it seems like it is completly ommited... Now I did some reading and it looks like EnumSingleValueConverter might somehow solve the problem …

Member Avatar
Member Avatar
+0 forum 1

The End.