先放着 没时间改了
来源:互联网 发布:b2c模式的淘宝的特点 编辑:程序博客网 时间:2024/04/28 20:25
@RequestMapping(value = "/test/save")
public @ResponseBody RetInfo saveApp(HttpServletRequest request) {
logger.debug("testing~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
ZipFile file;
ZipEntry entry = null;
//InputStream in = new BufferedInputStream(new FileInputStream(file));
try {
file = new ZipFile("f:\\test.zip");
Enumeration enu = file.entries();
while(enu.hasMoreElements()){
entry = (ZipEntry) enu.nextElement();
if(!entry.isDirectory()){
if(entry.getName().equals("test/app.xml")){
InputStream xmlFile=file.getInputStream(entry);
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
try {
DocumentBuilder db = dbf.newDocumentBuilder();
try {
Document doc = db.parse(xmlFile);
Element root = doc.getDocumentElement();
NodeList apps = root.getChildNodes();
if(apps != null){
for(int i=0;i<apps.getLength();i++){
Node app = apps.item(i);
if(app.getNodeType() == Node.ELEMENT_NODE){
Node info = app.getFirstChild();
System.out.println("appInfo1:"+info.getNodeValue());
System.out.println("appInfo2:"+info.getNodeName());
}
}
}
} catch (SAXException e) {
// TODO Auto-generated catch block
}
} catch (ParserConfigurationException e) {
// TODO Auto-generated catch block
}
}
}
}
//ZipEntry entry = file.getEntry("app.xml");
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
return null;
}
public @ResponseBody RetInfo saveApp(HttpServletRequest request) {
logger.debug("testing~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
ZipFile file;
ZipEntry entry = null;
//InputStream in = new BufferedInputStream(new FileInputStream(file));
try {
file = new ZipFile("f:\\test.zip");
Enumeration enu = file.entries();
while(enu.hasMoreElements()){
entry = (ZipEntry) enu.nextElement();
if(!entry.isDirectory()){
if(entry.getName().equals("test/app.xml")){
InputStream xmlFile=file.getInputStream(entry);
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
try {
DocumentBuilder db = dbf.newDocumentBuilder();
try {
Document doc = db.parse(xmlFile);
Element root = doc.getDocumentElement();
NodeList apps = root.getChildNodes();
if(apps != null){
for(int i=0;i<apps.getLength();i++){
Node app = apps.item(i);
if(app.getNodeType() == Node.ELEMENT_NODE){
Node info = app.getFirstChild();
System.out.println("appInfo1:"+info.getNodeValue());
System.out.println("appInfo2:"+info.getNodeName());
}
}
}
} catch (SAXException e) {
// TODO Auto-generated catch block
}
} catch (ParserConfigurationException e) {
// TODO Auto-generated catch block
}
}
}
}
//ZipEntry entry = file.getEntry("app.xml");
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
return null;
}
0 0
- 先放着 没时间改了
- 今天没时间了
- 没时间刷这个了。。
- 今天没时间写了
- 火车票预售时间改了
- 最近忙的没时间写日记了
- 有段时间没来了
- 最近没时间写日志了.....
- 我靠。。没时间学这门课了。。
- 飞鸽传书:不知不觉,时间又没了!
- 又有段时间没来了
- 没时间解释了,快使用Snackbar!
- 有段时间没写了~~
- 没时间解释了,我的处女作!
- 给了我时间,没抓住
- 上次这个题错了没改,心里就像有个事似的
- 没听老师话吧内容改了
- 崩溃!下了那么多的作品,时间没了,积分没了,结果还没存!郁闷~~~~
- VIM快捷键大全
- 【呆子谈营销】:定位,并不是万能药!
- delphi对ini的文件操作
- PTN 1588时间同步组网方案剖析
- 多进程拷贝文件 提高io效率 利用 文件空洞 内容很简单 原理很深刻
- 先放着 没时间改了
- 关闭子窗口时刷新父窗口js
- windows XP远程连接windows 2008方法
- Windows中检测联网(一)
- Algorithm学习笔记 --- 抽签
- Oracle 数据库 11g: 面向 DBA 和开发人员的重要新特性 - Pivot 和 Unpivot
- 系统标准全局变量的使用-默认屏幕
- linux shell 延时
- XP任务管理器显示程序路径,显示进程路径的任务管理器