Skip to content

Commit 15aa4fb

Browse files
author
Santiago Gala
committed
Remove commons-lang dependency
1 parent 6b4f07d commit 15aa4fb

File tree

7 files changed

+79
-90
lines changed

7 files changed

+79
-90
lines changed

core/pom.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,6 @@
9393
<groupId>org.apache.commons</groupId>
9494
<artifactId>commons-collections4</artifactId>
9595
</dependency>
96-
<dependency>
97-
<groupId>org.apache.commons</groupId>
98-
<artifactId>commons-lang3</artifactId>
99-
</dependency>
10096
<dependency>
10197
<groupId>commons-io</groupId>
10298
<artifactId>commons-io</artifactId>

core/src/main/groovy/noe/common/utils/VerifyURLBuilder.groovy

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import com.gargoylesoftware.htmlunit.Page
44
import com.gargoylesoftware.htmlunit.WebClient
55
import com.gargoylesoftware.htmlunit.WebResponse
66
import groovy.util.logging.Slf4j
7-
import org.apache.commons.lang3.StringUtils
87

98
import java.util.regex.Pattern
109

@@ -252,7 +251,7 @@ public final class VerifyURLBuilder {
252251
*/
253252
private Map build() {
254253
if (url == null) throw new IllegalArgumentException("URL must not be null.")
255-
if (StringUtils.isBlank(reqKey) != StringUtils.isBlank(reqValue)) {
254+
if (reqKey?.allWhitespace != reqValue?.allWhitespace) {
256255
throw new IllegalArgumentException("ReqKey and ReqValue have to have to be either both set or both empty.")
257256
}
258257

core/src/main/groovy/noe/common/utils/XmlUtils.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import groovy.xml.XmlUtil
99
*/
1010
class XmlUtils {
1111

12+
//FIXME: write a escapeXml10 or similar method and use it for StringEscapeUtils.escapeXml10
13+
1214
static void writeXmlToFile(File file, GPathResult xml) {
1315
file.withWriter { outWriter ->
1416
XmlUtil.serialize(new StreamingMarkupBuilder().bind {

core/src/main/groovy/noe/eap/utils/CLILib.groovy

Lines changed: 68 additions & 69 deletions
Large diffs are not rendered by default.

core/src/main/groovy/noe/eap/utils/XSLTStaticLib.groovy

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package noe.eap.utils
33
import noe.common.DefaultProperties
44
import noe.common.utils.Library
55
import noe.eap.server.as7.AS7Properties
6-
import org.apache.commons.lang3.StringEscapeUtils
6+
import groovy.xml.XmlUtil
77

88
import javax.xml.transform.Transformer
99
import javax.xml.transform.TransformerFactory
@@ -52,7 +52,7 @@ class XSLTStaticLib {
5252
*/
5353
def static addOrUpdateSystemProperties(String propertyName = "evilprop", String propertyValue = "something", String absolutePathToConfig) {
5454
def xslt = Library.retrieveResourceAsFile(RELATIVE_XSLT_PATH + "/system-properties.xsl").getText().replace("@SYSTEM_PROPERTY_NAME@", propertyName)
55-
xslt = xslt.replace("@SYSTEM_PROPERTY_VALUE@", StringEscapeUtils.escapeXml10(propertyValue))
55+
xslt = xslt.replace("@SYSTEM_PROPERTY_VALUE@", XmlUtil.escapeXml(propertyValue))
5656
transformIt(xslt, new File(absolutePathToConfig))
5757
}
5858

@@ -132,9 +132,9 @@ class XSLTStaticLib {
132132
xslt = xslt.replace("@ENABLED@", enabled.toString())
133133
xslt = xslt.replace("@SCHEME@", scheme)
134134
xslt = xslt.replace("@SECURE@", secure.toString())
135-
xslt = xslt.replace("@CA_CERTIFICATE_FILE@", StringEscapeUtils.escapeXml10(caCertificateFile))
136-
xslt = xslt.replace("@CERTIFICATE_KEY_FILE@", StringEscapeUtils.escapeXml10(certificateKeyFile))
137-
xslt = xslt.replace("@CERTIFICATE_FILE@", StringEscapeUtils.escapeXml10(certificateFile))
135+
xslt = xslt.replace("@CA_CERTIFICATE_FILE@", XmlUtil.escapeXml(caCertificateFile))
136+
xslt = xslt.replace("@CERTIFICATE_KEY_FILE@", XmlUtil.escapeXml(certificateKeyFile))
137+
xslt = xslt.replace("@CERTIFICATE_FILE@", XmlUtil.escapeXml(certificateFile))
138138
xslt = xslt.replace("@PASSWORD@", password)
139139
xslt = xslt.replace("@VERIFY_CLIENT@", verifyClient.toString())
140140
xslt = xslt.replace("@KEY_ALIAS@", keyAlias)
@@ -348,8 +348,8 @@ class XSLTStaticLib {
348348
String ssl_protocol = "TLS",
349349
String absolutePathToConfig) {
350350
def xslt = Library.retrieveResourceAsFile(RELATIVE_XSLT_PATH + "/mod-cluster-ssl-config.xsl").getText()
351-
xslt = xslt.replace("@CA_CERTIFICATE_FILE@", StringEscapeUtils.escapeXml10(caCertificateFile))
352-
xslt = xslt.replace("@CERTIFICATE_KEY_FILE@", StringEscapeUtils.escapeXml10(certificateKeyFile))
351+
xslt = xslt.replace("@CA_CERTIFICATE_FILE@", XmlUtil.escapeXml(caCertificateFile))
352+
xslt = xslt.replace("@CERTIFICATE_KEY_FILE@", XmlUtil.escapeXml(certificateKeyFile))
353353
xslt = xslt.replace("@PASSWORD@", password)
354354
xslt = xslt.replace("@KEY_ALIAS@", keyAlias)
355355
xslt = xslt.replace("@CIPHER_SUITE@", cipherSuite)

core/src/main/groovy/noe/ews/server/tomcat/TomcatWindows.groovy

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import noe.common.utils.Library
66
import noe.common.utils.Version
77
import noe.ews.server.ServerEws
88
import noe.server.Tomcat
9-
import org.apache.commons.lang3.StringUtils
109
/**
1110
* EWS Tomcat server on Windows
1211
*
@@ -116,7 +115,7 @@ class TomcatWindows extends Tomcat {
116115
*/
117116
private String configureTomcatWindowTitle() {
118117
boolean success = false
119-
if (StringUtils.isNotEmpty(this.processCode) && this.processCode != '0' && this.processCode != this.windowTitle) {
118+
if (this.processCode && this.processCode != '0' && this.processCode != this.windowTitle) {
120119
if (version == new Version("6")) {
121120
success = updateBinReplaceRegExp('catalina.bat', "set _EXECJAVA=start \"[^\"]*\"", "set _EXECJAVA=start \"${this.processCode}\"", true, false)
122121
}

pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@
126126
<org.jboss.as.creaper.dependencies.version>7.5.23.Final-redhat-00002</org.jboss.as.creaper.dependencies.version>
127127

128128
<commons-collections4.version>4.4</commons-collections4.version>
129-
<commons-lang3.version>3.4</commons-lang3.version>
130129
<commons-io.version>2.7</commons-io.version>
131130

132131
<xml-apis.version>1.4.01</xml-apis.version>
@@ -242,11 +241,6 @@
242241
<artifactId>commons-collections4</artifactId>
243242
<version>${commons-collections4.version}</version>
244243
</dependency>
245-
<dependency>
246-
<groupId>org.apache.commons</groupId>
247-
<artifactId>commons-lang3</artifactId>
248-
<version>${commons-lang3.version}</version>
249-
</dependency>
250244
<dependency>
251245
<groupId>commons-io</groupId>
252246
<artifactId>commons-io</artifactId>

0 commit comments

Comments
 (0)