Package com.dotcms.repackage.com.thoughtworks.xstream

Examples of com.dotcms.repackage.com.thoughtworks.xstream.XStream.fromXML()


      XStream xstream = new XStream(new DomDriver("UTF-8"));

      BufferedInputStream input = null;
    try {
      input = new BufferedInputStream(new FileInputStream(f));
      Object ret = xstream.fromXML(input);
      return ret;
    } catch (FileNotFoundException e) {
      Logger.error(BundlerUtil.class,e.getMessage(),e);
      return null;
    }finally{
View Full Code Here


  public static PublishAuditHistory getObjectFromString(String serializedString) {
    PublishAuditHistory ret = null;
    XStream xstream=new XStream(new DomDriver());
    if(UtilMethods.isSet(serializedString)){
      try{
        return (PublishAuditHistory) xstream.fromXML(serializedString);
      }
      catch(Exception e){
        Logger.error(PublishAuditHistory.class, e.getMessage(), e);
      }
    }else{
View Full Code Here

        } else {

           _dh = new HibernateUtil(_importClass);
           _bin = new BufferedInputStream(new FileInputStream(f));
           List l = (List) _xstream.fromXML(_bin);
           out.println("Found :\t" + l.size() + " " + _className + "(s)");
           String id = _dh.getSession().getSessionFactory().getClassMetadata(_importClass).getIdentifierPropertyName();
           for (int j = 0; j < l.size(); j++) {
            Object obj = l.get(j);
            if (UtilMethods.isSet(id)) {
View Full Code Here

                charStream = new InputStreamReader(new FileInputStream(file), "UTF-8");
            }catch (UnsupportedEncodingException uet) {
                Logger.error(this, "Reader doesn't not recoginize Encoding type: ", uet);
            }
            try{
                roles.addAll((List<Role>) _xstream.fromXML(charStream));
            }catch(Exception e){
                Logger.error(this, "Unable to import " + _className, e);
            }
        }
View Full Code Here

            final List<Identifier> folderIdents=new ArrayList<Identifier>();
            final XStream xstream = new XStream();

            // collecting all folder identifiers
            for(File ff : identifiersXML) {
                List<Identifier> idents=(List<Identifier>)xstream.fromXML(new FileInputStream(ff));
                for(Identifier ident : idents) {
                    if(ident.getAssetType().equals("folder"))
                        folderIdents.add(ident);
                }
            }
View Full Code Here

            }catch (UnsupportedEncodingException uet) {
                Logger.error(this, "Reader doesn't not recoginize Encoding type: ", uet);
            }
            List l = new ArrayList();
            try{
                List all = (List) _xstream.fromXML(charStream);
                if(filter!=null) {
                    for(Object obj : all)
                        if(filter.includeIt(obj))
                            l.add(obj);
                }
View Full Code Here

  @SuppressWarnings("unchecked")
  protected void processXML(Contentlet contentlet, InputStream input) {
    XStream xstream=new XStream(new DomDriver());
    xstream.alias("content", Map.class);
    xstream.registerConverter(new MapEntryConverter());
    Map<String,Object> root=(Map<String,Object>) xstream.fromXML(input);
    processMap(contentlet,root);
  }

  protected void processForm ( Contentlet contentlet, InputStream input ) throws Exception {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.