Skip to content

Commit

Permalink
Involving groovy URLEncoder
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahad Mammadov committed Dec 6, 2024
1 parent af0b19e commit 4ae9130
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,9 @@ THE SOFTWARE.
<j:set var="rawPath" value="${f.getRelativePathFrom(it)}" />
<j:set var="encodedRelativePath">
<j:forEach items="${rawPath.split('/')}" var="component" varStatus="i">
<j:trim var="trimmedComponent" value="${component}" />
<j:invokeStatic var="encodedComponent" className="java.net.URLEncoder" method="encode">
<j:arg value="${trimmedComponent.toString()}" />
<j:arg value="UTF-8" />
</j:invokeStatic>
<j:set var="encodedComponent">
${groovy:URLEncoder.encode(component, 'UTF-8')}
</j:set>
<j:if test="${i.index > 0}">/</j:if>${encodedComponent}
</j:forEach>
</j:set>
Expand Down

0 comments on commit 4ae9130

Please sign in to comment.