java根据smil文件路径获得smil文件中src=的值

/**
* 根据smil文件路径获得smil文件中src=""的值<br>
* >>>>>已通过测试<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;
}

你可能感兴趣的:(java)