Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jar file with bad directory structure #2

Open
GoogleCodeExporter opened this issue May 8, 2015 · 4 comments
Open

jar file with bad directory structure #2

GoogleCodeExporter opened this issue May 8, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link

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/
 * 作者:梁平 (no_ten@163.com) 
 * 创建时间: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 wanxiang.xing@gmail.com on 9 Oct 2009 at 4:57

@GoogleCodeExporter
Copy link
Author

Original comment by wanxiang.xing@gmail.com on 9 Oct 2009 at 5:00

Attachments:

@GoogleCodeExporter
Copy link
Author

Document doc =  parser.parse(new InputSource(new StringReader(input)));

Original comment by wanxiang.xing@gmail.com on 9 Oct 2009 at 5:21

@GoogleCodeExporter
Copy link
Author

result.add(nl.item(i).getChildNodes().item(0).toString());

Original comment by wanxiang.xing@gmail.com on 10 Oct 2009 at 12:25

@GoogleCodeExporter
Copy link
Author

Original comment by wanxiang.xing@gmail.com on 10 Oct 2009 at 12:28

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant