Skip to content

Commit

Permalink
fixing version search priority
Browse files Browse the repository at this point in the history
  • Loading branch information
Idrinth committed Apr 24, 2021
1 parent 55362bb commit 20d0802
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.idrinth</groupId>
<artifactId>WARAddonClient</artifactId>
<version>1.4.0</version>
<version>1.4.1</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,17 +329,18 @@ private boolean processDirectory() {
/**
* tries to find and set the default version
*/
private void getDownloadVersion() {
private boolean getDownloadVersion() {
java.io.File file = new java.io.File(folder.getPath() + versionFile);
if (file.exists()) {
try {
org.w3c.dom.NodeList list = javax.xml.parsers.DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(file).getElementsByTagName("version");
installed = list.item(0).getTextContent();
return true;
} catch (javax.xml.parsers.ParserConfigurationException | javax.xml.parsers.FactoryConfigurationError | org.xml.sax.SAXException | java.io.IOException exception) {
de.idrinth.factory.Logger.build().log(exception, de.idrinth.Logger.levelError);
}
}

return false;
}

/**
Expand All @@ -349,11 +350,9 @@ public void run() {
if (folder == null || !folder.exists()) {
return;
}
installed = "unknown";
if (processDirectory()) {
return;
if (!getDownloadVersion() && !processDirectory()) {
installed = "unknown";
}
getDownloadVersion();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class Request {

private org.apache.http.impl.client.CloseableHttpClient client;

private javax.net.ssl.SSLContext sslContext;
private final javax.net.ssl.SSLContext sslContext;

/**
* Throws an exception if there's issues with the ssl-certificates
Expand Down

0 comments on commit 20d0802

Please sign in to comment.