Commit 43d2cee2 by zhongmh

Update InfoXmlResolver.java

parent 48eef60e
......@@ -8,6 +8,8 @@ import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
......@@ -23,6 +25,7 @@ import java.util.List;
@Component
public class InfoXmlResolver {
private final Logger logger;
private final SystemFile systemFile;
private final Project project;
private SAXReader saxReader;
......@@ -33,7 +36,8 @@ public class InfoXmlResolver {
this.systemFile = systemFile;
this.project = project;
this.emailService = emailService;
saxReader = new SAXReader();
this.saxReader = new SAXReader();
this.logger = LoggerFactory.getLogger(InfoXmlResolver.class);
}
/**
......@@ -41,9 +45,12 @@ public class InfoXmlResolver {
*
* @param resourceFileName
*/
public synchronized void resolver(String resourceFileName) throws DocumentException, IOException {
public void resolver(String resourceFileName) throws DocumentException, IOException {
File projectFileName = new File(systemFile.getWwwDir(), resourceFileName);
File infoXml = new File(projectFileName, "info.xml");
if (!infoXml.exists()) {
return;
}
Document document = saxReader.read(infoXml);
Element artifactId = document.getRootElement().element("artifactId");
Element version = document.getRootElement().element("version");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment