在JAVA中如何读取smil格式的文件啊???????
解决方案 »
- jsp中如何定义一个只在本jsp页面使用的变量
- 征求SWFUpload 批量上传的例子
- java web程序如何使用windows active directory登陆?
- 在Struts2中,如何使用JSTL来读取Action中的变量?
- jsp 新手问题 大家来帮忙
- 请分析下这段代码
- rar文件会点击连接地址后打开一个窗口出现一些乱码
- 页面装载完成之前显示一个滚动条的效果。
- 新人求助,关于hibernate的executeFind()分页问题
- 给大家推荐一个JSP论坛源代码。比较优秀,值得下载研究一下。
- 求高手指点,jquery技术 返回值不理想
- tomcat server.xml中的URIEncoding="UTF-8"????
* 根据smil文件路径获得smil文件中src=""的值<br>
* @param smilFilePath
* @return
*/
protected List<String[]> getSrcValues(String smilFilePath) {
List<String[]> srcValues = new ArrayList<String[]>();;
String content = "";
try {
File smilFile = new File(smilFilePath);
FileInputStream fis = new FileInputStream(smilFile);
BufferedReader br = new BufferedReader(new InputStreamReader(fis)); String line = "";
while ((line = br.readLine()) != null) {
content += line + "\r\n";
} } catch (Exception e) {
e.printStackTrace();
}
int srcCount=getSrcCount(smilFilePath);
int count=0;
while(content.indexOf("src=\"")!=-1){
String test="";
content=content.substring(content.indexOf("src=\"")+5);
test=content.substring(0, content.indexOf("\""));
//System.out.println("###test["+count+"]:"+test); String valuesList[]=new String[srcCount];;
valuesList[count]=test;
System.out.println("###valuesList["+count+"]:"+valuesList[count]);
srcValues.add(valuesList);
count++;
} return srcValues;
<head>
<layout>
<root-layout width="208" height="176" />
<region id="Image" left="0" top="0" width="128" height="128" fit="hidden" />
<region id="Text" left="0" top="50" width="128" height="128" fit="hidden" />
</layout>
</head>
<body>
<par dur="25000ms">
<img src="1.jpg" region="Image" />
<text src="1.txt" region="Text" />
</par>
<par dur="25000ms">
<img src="2.gif" region="Image" />
<text src="2.txt" region="Text" />
</par>
</body>
</smil>
我要获得的是width,height和src那引号里面的值啊!!!