public List<Element> readXml(String filePath){
List<Element> list = null;
FileInputStream fis = null;
FileChannel fc = null;
FileLock fl = null;
try{
// File file = new File(filePath);
fis = new FileInputStream(filePath);
fc = fis.getChannel();
fl = fc.tryLock(0,Long.MAX_VALUE,true);
SAXReader saxReader = new SAXReader();
Document document = saxReader.read(fis);
Element rootElement = document.getRootElement();
list = rootElement.elements();
}catch (Exception e) {
e.printStackTrace();
}finally{
try{
if(null != fl){
fl.release();
fl.close();
}
if(null != fc&&fc.isOpen()){
fc.close();
}
if(null != fis){
fis.close();
}
}catch(Exception e){
e.printStackTrace();
}
}
return list;
}