GithubHelp home page GithubHelp logo

discuz-ucenter-api-for-java's People

Watchers

 avatar

discuz-ucenter-api-for-java's Issues

jar file with bad directory structure

1.Current jar file contain the 'class/com/fivestars/...'
shold be 'com/fivestars/...'

2.When I build with maven, there warning :  "Sun proprietary api" 

recommedate replace the "XMLHelper.java" with code below:

//-------------------------------------------------
package com.fivestars.interfaces.bbs.util;

import java.io.IOException;
import java.util.LinkedList;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;


/**
 * ================================================
 * Discuz! Ucenter API for JAVA
 * ================================================
 * XML工具类,处理UC Client接收到返回结果。
 * UC Client会收到UC Server返回的XML结果
 * 该类将XML中的数据提取成一个List按顺序读取即可。
 * 
 * 更多信息:http://code.google.com/p/discuz-ucenter-api-for-java/
 * 作者:梁平 ([email protected]) 
 * 创建时间:2009-2-20
 */
public class XMLHelper {

    public static LinkedList<String> uc_unserialize(String input){

        LinkedList<String> result = new LinkedList<String>();
           DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
           DocumentBuilder parser = null;

        //DOMParser parser = new DOMParser();
        try {           
            parser = factory.newDocumentBuilder();

            Document doc =  parser.parse(input);
            //Document doc = parser.getDocument();
            NodeList nl = doc.getChildNodes().item(0).getChildNodes();
            int length = nl.getLength();
            for(int i=0;i<length;i++){
                if(nl.item(i).getNodeType()==Document.ELEMENT_NODE)
                    result.add(nl.item(i).getTextContent());
            }
        } catch (SAXException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } catch (ParserConfigurationException e1) {
            // TODO Auto-generated catch block
            e1.printStackTrace();
        }
        return result;
    }
}

Original issue reported on code.google.com by [email protected] on 9 Oct 2009 at 4:57

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.