Package com.thoughtworks.xstream.io.xml

Examples of com.thoughtworks.xstream.io.xml.Dom4JDriver


                String textValue = res.getString(3);
                if (type == WGDocumentImpl.ITEMTYPE_NUMBER) {
                    patchLevel = numberValue.intValue();
                }
                else if (type == WGDocumentImpl.ITEMTYPE_SERIALIZED_XSTREAM) {
                    XStream xstream = new XStream(new Dom4JDriver());
                    patchLevel = ((Number) xstream.fromXML(textValue)).intValue();
                }
            }
        }
        catch (Exception e) {
View Full Code Here


                // write Ascii
                _foutASCII.write(assertion.toString() + "\n");
                _foutASCII.flush();
                // write XML
                FileWriter foutXML = new FileWriter(xmlFilePath);
                new XStream(new Dom4JDriver()).toXML(_assertions, foutXML);
                foutXML.close();
               
            }
            catch (IOException e) {
                _logEnabled = false;               
View Full Code Here

            ajaxInfo.setSuperform(getStatus().getRelevantForm());

           
            // create javascript object with ajaxInfo                   
            // serialize       
            String serAjaxInfo = new XStream(new Dom4JDriver()).toXML(ajaxInfo);
            // zip
            byte[] zipped  = Zipper.zip(serAjaxInfo);
            String encryptedAjaxInfo = "";
            if (zipped != null) {
                // encrypt
View Full Code Here

                throw new HttpErrorException(HttpURLConnection.HTTP_INTERNAL_ERROR, "Retrieved AjaxInfo could not be decrypted. Maybe the ajax call was defined for another WGA instance.", null);
            }
            // unzip
            String unzipped = Zipper.unzip(zipped);
            // deserialize
            ajaxInfo = (AjaxInfo) new XStream(new Dom4JDriver()).fromXML(unzipped);
            // put ajaxInfo on request so root tag can retrieve it
            request.setAttribute(WGACore.ATTRIB_AJAXINFO, ajaxInfo);
        }
        catch (HttpErrorException e) {
            throw e;
View Full Code Here

   
    static String serializeFormInfo(FormInfo info, TMLContext context) throws UnsupportedEncodingException {
      // optimze formInfo
      info.optimize();
        // serialize FormInfo       
        String serFormInfo = new XStream(new Dom4JDriver()).toXML(info);       
        byte[] zipped  = Zipper.zip(serFormInfo);
        if (zipped != null) {
            // encrypt
            return context.getwgacore().getDesEncrypter().encrypt(zipped);
        }
View Full Code Here

                   
                    if (serFormInfo != null) {
                     // unzip
                     String unzipped = Zipper.unzip(serFormInfo);
                     // deserialize
                     _formInfo = (FormInfo) new XStream(new Dom4JDriver()).fromXML(unzipped);
                    }
                    else {
                        log.error("Error in TMLForm. Field '$forminfo' was unreadable");
                    }
                }
View Full Code Here

           
            private static final int MAX_FAILURES = 5;
           
            public ClientWorker(Socket client) {
                _client = client;
                _xstream = new XStream(new Dom4JDriver());
                _failures = 0;
            }
View Full Code Here

     * @param port The server port
     */
    public Client(String host, int port) {
        _host = host;
        _port = port;
        _xstream = new XStream(new Dom4JDriver());       
    }
View Full Code Here

     * @param classLoader The classloader to use for serialization of command-beans
     */
    public Client(String host, int port, ClassLoader classLoader) {
        _host = host;
        _port = port;
        _xstream = new XStream(new Dom4JDriver());
        if (classLoader != null) {
          _xstream.setClassLoader(classLoader);
        }
    }
View Full Code Here

        if (RSAEncryptedData.isEncryptedValue(value)) {
            RSAEncryptedData data = RSAEncryptedData.deserialize((String)value);

            byte[] decryptedData = decrypt(data);           
            String serialized = new String(decryptedData, "UTF-8");  
            return new XStream(new Dom4JDriver()).fromXML(serialized);
        }
        return value;
    }
View Full Code Here

TOP

Related Classes of com.thoughtworks.xstream.io.xml.Dom4JDriver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.