Updated dependencies.

This commit is contained in:
Erik C. Thauvin 2022-03-25 11:50:32 -07:00
parent e77c8595cb
commit 7dc9a51a7f
16 changed files with 449 additions and 295 deletions

View file

@ -1,15 +1,12 @@
version: 2
jobs:
build:
docker:
- image: circleci/openjdk:8-jdk
defaults: &defaults
working_directory: ~/repo
environment:
JVM_OPTS: -Xmx3200m
TERM: dumb
CI_NAME: "CircleCI"
defaults_gradle: &defaults_gradle
steps:
- checkout
- restore_cache:
@ -17,21 +14,42 @@ jobs:
- gradle-dependencies-{{ checksum "build.gradle" }}
# fallback to using the latest cache if no exact match is found
- gradle-dependencies-
- run:
name: Gradle Dependencies
command: ./gradlew dependencies
- save_cache:
paths: ~/.m2
paths:
- ~/.m2
key: gradle-dependencies-{{ checksum "build.gradle" }}
- run:
name: Run All Checks
command: ./gradlew check
- store_artifacts:
path: build/reports/
destination: reports
- store_test_results:
path: build/reports/
jobs:
build_gradle_jdk17:
<<: *defaults
docker:
- image: cimg/openjdk:17.0
<<: *defaults_gradle
build_gradle_jdk8:
<<: *defaults
docker:
- image: circleci/openjdk:8-jdk
<<: *defaults_gradle
workflows:
version: 2
gradle:
jobs:
- build_gradle_jdk8
- build_gradle_jdk17

View file

@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
java-version: [ 1.8, 11, 15 ]
java-version: [ 1.8, 11, 17, 18 ]
steps:
- uses: actions/checkout@v2

1
.idea/.name generated Normal file
View file

@ -0,0 +1 @@
httpstatus

9
.idea/HttpStatus.iml generated
View file

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
.idea/compiler.xml generated Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="1.8" />
</component>
</project>

View file

@ -2,7 +2,6 @@
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="AndroidLintNewerVersionAvailable" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="FieldMayBeFinal" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="FieldNamingConvention" enabled="true" level="WARNING" enabled_by_default="true">
<extension name="InstanceVariableNamingConvention" enabled="true">
<option name="m_regex" value="^[a-z][a-z0-9][a-zA-Z0-9]*$" />
@ -47,13 +46,9 @@
<option name="REPORT_VARIABLES" value="true" />
<option name="REPORT_PARAMETERS" value="true" />
<option name="REPORT_CATCH_PARAMETERS" value="false" />
<option name="REPORT_IMPLICIT_FINALS" value="false" />
</inspection_tool>
<inspection_tool class="NonFinalUtilityClass" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="UnnecessarySemicolon" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="WeakerAccess" enabled="false" level="WARNING" enabled_by_default="false">
<option name="SUGGEST_PACKAGE_LOCAL_FOR_MEMBERS" value="true" />
<option name="SUGGEST_PACKAGE_LOCAL_FOR_TOP_CLASSES" value="true" />
<option name="SUGGEST_PRIVATE_FOR_INNERS" value="false" />
</inspection_tool>
</profile>
</component>

30
.idea/jarRepositories.xml generated Normal file
View file

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="MavenLocal" />
<option name="name" value="MavenLocal" />
<option name="url" value="file:$MAVEN_REPOSITORY$/" />
</remote-repository>
<remote-repository>
<option name="id" value="MavenRepo" />
<option name="name" value="MavenRepo" />
<option name="url" value="https://repo.maven.apache.org/maven2/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven" />
<option name="name" value="maven" />
<option name="url" value="https://oss.sonatype.org/content/repositories/snapshots" />
</remote-repository>
</component>
</project>

2
.idea/misc.xml generated
View file

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="18" project-jdk-type="JavaSDK" />
</project>

8
.idea/modules.xml generated
View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/HttpStatus.iml" filepath="$PROJECT_DIR$/.idea/HttpStatus.iml" />
</modules>
</component>
</project>

1
.idea/vcs.xml generated
View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$USER_HOME$/Documents/Projects/HttpStatus" vcs="Git" />
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View file

@ -23,7 +23,7 @@ cache:
environment:
matrix:
- JAVA_HOME: C:\Program Files\Java\jdk15
- JAVA_HOME: C:\Program Files\Java\jdk17
- JAVA_HOME: C:\Program Files\Java\jdk11
matrix:

View file

@ -1,5 +1,4 @@
plugins {
id 'checkstyle'
id 'java'
id 'jacoco'
id 'idea'
@ -7,10 +6,10 @@ plugins {
id 'maven-publish'
id 'signing'
id 'pmd'
id 'com.github.ben-manes.versions' version '0.38.0'
id 'com.github.ben-manes.versions' version '0.42.0'
id 'net.thauvin.erik.gradle.semver' version '1.0.4'
id 'com.github.spotbugs' version '4.7.1'
id 'org.sonarqube' version '3.2.0'
id 'com.github.spotbugs' version '5.0.6'
id 'org.sonarqube' version '3.3'
}
import com.github.spotbugs.snom.SpotBugsTask
@ -35,20 +34,20 @@ mainClassName = 'net.thauvin.erik.httpstatus.Reasons'
ext {
versions = [
pmd: '6.35.0',
spotbugs: '4.2.3'
spotbugs: '4.6.0'
]
}
repositories {
mavenLocal()
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}
dependencies {
implementation 'javax.servlet:javax.servlet-api:4.0.1'
implementation 'javax.servlet.jsp:jsp-api:2.2.1-b03'
implementation 'javax.el:javax.el-api:3.0.1-b06'
compileOnly 'javax.servlet:javax.servlet-api:4.0.1'
compileOnly 'javax.servlet.jsp:jsp-api:2.2.1-b03'
compileOnly 'javax.el:javax.el-api:3.0.1-b06'
spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.11.0'
spotbugsPlugins 'com.mebigfatguy.sb-contrib:sb-contrib:7.4.7'
@ -56,7 +55,7 @@ dependencies {
compileOnly "com.github.spotbugs:spotbugs-annotations:$versions.spotbugs"
testCompileOnly "com.github.spotbugs:spotbugs-annotations:$versions.spotbugs"
testImplementation 'org.testng:testng:7.4.0'
testImplementation 'org.testng:testng:7.5'
}
tasks.withType(JavaCompile) {
@ -114,13 +113,6 @@ pmd {
consoleOutput = true
}
tasks.withType(Checkstyle) {
reports {
xml.enabled = false
html.enabled = true
}
}
tasks.withType(SpotBugsTask) {
reports {
xml.enabled = false
@ -223,9 +215,13 @@ task pandoc(type: Exec) {
}
}
jacoco {
toolVersion = '0.8.8-SNAPSHOT'
}
jacocoTestReport {
reports {
xml.enabled true
xml.required = true
}
}

View file

@ -5,74 +5,75 @@
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<title>HttpStatus JSP Tag Library</title>
<style type="text/css">
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
</style>
<style type="text/css">
a.sourceLine { display: inline-block; line-height: 1.25; }
a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; }
a.sourceLine:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode { white-space: pre; position: relative; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
code.sourceCode { white-space: pre-wrap; }
a.sourceLine { text-indent: -1em; padding-left: 1em; }
}
pre.numberSource a.sourceLine
{ position: relative; left: -4em; }
pre.numberSource a.sourceLine::before
{ content: attr(title);
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; pointer-events: all; display: inline-block;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
color: #aaaaaa;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
a.sourceLine::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; } /* Alert */
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #7d9029; } /* Attribute */
code span.bn { color: #40a070; } /* BaseN */
code span.bu { } /* BuiltIn */
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4070a0; } /* Char */
code span.cn { color: #880000; } /* Constant */
code span.co { color: #60a0b0; font-style: italic; } /* Comment */
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #ba2121; font-style: italic; } /* Documentation */
code span.dt { color: #902000; } /* DataType */
code span.dv { color: #40a070; } /* DecVal */
code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #40a070; } /* Float */
code span.fu { color: #06287e; } /* Function */
code span.im { } /* Import */
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #007020; font-weight: bold; } /* Keyword */
code span.op { color: #666666; } /* Operator */
code span.ot { color: #007020; } /* Other */
code span.pp { color: #bc7a00; } /* Preprocessor */
code span.sc { color: #4070a0; } /* SpecialChar */
code span.ss { color: #bb6688; } /* SpecialString */
code span.st { color: #4070a0; } /* String */
code span.va { color: #19177c; } /* Variable */
code span.vs { color: #4070a0; } /* VerbatimString */
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; } /* Alert */
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #7d9029; } /* Attribute */
code span.bn { color: #40a070; } /* BaseN */
code span.bu { } /* BuiltIn */
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4070a0; } /* Char */
code span.cn { color: #880000; } /* Constant */
code span.co { color: #60a0b0; font-style: italic; } /* Comment */
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #ba2121; font-style: italic; } /* Documentation */
code span.dt { color: #902000; } /* DataType */
code span.dv { color: #40a070; } /* DecVal */
code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #40a070; } /* Float */
code span.fu { color: #06287e; } /* Function */
code span.im { } /* Import */
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #007020; font-weight: bold; } /* Keyword */
code span.op { color: #666666; } /* Operator */
code span.ot { color: #007020; } /* Other */
code span.pp { color: #bc7a00; } /* Preprocessor */
code span.sc { color: #4070a0; } /* SpecialChar */
code span.ss { color: #bb6688; } /* SpecialString */
code span.st { color: #4070a0; } /* String */
code span.va { color: #19177c; } /* Variable */
code span.vs { color: #4070a0; } /* VerbatimString */
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
</style>
<link rel="stylesheet" href="github-pandoc.css" />
</head>
@ -83,24 +84,36 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
<a href="https://github.com/ethauvin/httpstatus/actions/workflows/gradle.yml"><img src="https://github.com/ethauvin/httpstatus/actions/workflows/gradle.yml/badge.svg" alt="GitHub CI" /></a> <a href="https://ci.appveyor.com/project/ethauvin/httpstatus"><img src="https://ci.appveyor.com/api/projects/status/w5j4kul3w2rkigxb?svg=true" alt="Build status" /></a> <a href="https://circleci.com/gh/ethauvin/HttpStatus/tree/master"><img src="https://circleci.com/gh/ethauvin/HttpStatus/tree/master.svg?style=shield" alt="CircleCI" /></a></p>
<p>A simple <a href="http://www.oracle.com/technetwork/java/javaee/jsp/index.html">JSP</a> Tag Library to display the <a href="#hscode">code</a>, <a href="#hsreason">reason</a>, <a href="#hscode">cause</a> and/or <a href="#hsmessage">message</a> for <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html">HTTP status codes</a> in JSP error pages.</p>
<p>For example:</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode jsp"><code class="sourceCode jsp"><a class="sourceLine" id="cb1-1" title="1">&lt;%@ page<span class="ot"> isErrorPage</span>=<span class="st">&quot;true&quot;</span><span class="ot"> </span>%&gt;</a>
<a class="sourceLine" id="cb1-2" title="2">&lt;%@ taglib<span class="ot"> prefix</span>=<span class="st">&quot;hs&quot;</span><span class="ot"> uri</span>=<span class="st">&quot;http://erik.thauvin.net/taglibs/httpstatus&quot;</span><span class="ot"> </span>%&gt;</a>
<a class="sourceLine" id="cb1-3" title="3">&lt;html&gt;&lt;head&gt;</a>
<a class="sourceLine" id="cb1-4" title="4">&lt;title&gt;<span class="kw">&lt;hs:code/&gt;</span> <span class="kw">&lt;hs:reason</span><span class="ot"> default</span>=<span class="dt">&quot;Server Error&quot;</span><span class="kw">/&gt;</span>&lt;/title&gt;</a>
<a class="sourceLine" id="cb1-5" title="5">&lt;/head&gt;</a>
<a class="sourceLine" id="cb1-6" title="6">&lt;h1&gt;<span class="kw">&lt;hs:reason</span><span class="ot"> default</span>=<span class="dt">&quot;Server Error&quot;</span><span class="kw">/&gt;</span>&lt;/h1&gt;</a>
<a class="sourceLine" id="cb1-7" title="7">Cause: &lt;pre&gt;<span class="kw">&lt;hs:cause</span><span class="ot"> default</span>=<span class="dt">&quot;Unable to complete your request.&quot;</span><span class="kw">/&gt;</span>&lt;/pre&gt;</a>
<a class="sourceLine" id="cb1-8" title="8">Message: &lt;pre&gt;<span class="kw">&lt;hs:message</span><span class="ot"> default</span>=<span class="dt">&quot;A server error has occured.&quot;</span><span class="kw">/&gt;</span>&lt;/pre&gt;</a>
<a class="sourceLine" id="cb1-9" title="9">...</a></code></pre></div>
<div class="sourceCode" id="cb1"><pre class="sourceCode jsp"><code class="sourceCode jsp"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true"></a><span class="bu">&lt;%@ page</span><span class="ot"> isErrorPage</span>=<span class="st">&quot;true&quot;</span><span class="ot"> </span><span class="bu">%&gt;</span></span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true"></a><span class="bu">&lt;%@ taglib</span><span class="ot"> prefix</span>=<span class="st">&quot;hs&quot;</span><span class="ot"> uri</span>=<span class="st">&quot;http://erik.thauvin.net/taglibs/httpstatus&quot;</span><span class="ot"> </span><span class="bu">%&gt;</span></span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true"></a>&lt;html&gt;&lt;head&gt;</span>
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true"></a>&lt;title&gt;<span class="kw">&lt;hs:code/&gt;</span> <span class="kw">&lt;hs:reason</span><span class="ot"> default</span>=<span class="dt">&quot;Server Error&quot;</span><span class="kw">/&gt;</span>&lt;/title&gt;</span>
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true"></a>&lt;/head&gt;</span>
<span id="cb1-6"><a href="#cb1-6" aria-hidden="true"></a>&lt;h1&gt;<span class="kw">&lt;hs:reason</span><span class="ot"> default</span>=<span class="dt">&quot;Server Error&quot;</span><span class="kw">/&gt;</span>&lt;/h1&gt;</span>
<span id="cb1-7"><a href="#cb1-7" aria-hidden="true"></a>Cause: &lt;pre&gt;<span class="kw">&lt;hs:cause</span><span class="ot"> default</span>=<span class="dt">&quot;Unable to complete your request.&quot;</span><span class="kw">/&gt;</span>&lt;/pre&gt;</span>
<span id="cb1-8"><a href="#cb1-8" aria-hidden="true"></a>Message: &lt;pre&gt;<span class="kw">&lt;hs:message</span><span class="ot"> default</span>=<span class="dt">&quot;A server error has occured.&quot;</span><span class="kw">/&gt;</span>&lt;/pre&gt;</span>
<span id="cb1-9"><a href="#cb1-9" aria-hidden="true"></a>...</span></code></pre></div>
<p>or</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode jsp"><code class="sourceCode jsp"><a class="sourceLine" id="cb2-1" title="1">&lt;%@ page<span class="ot"> isErrorPage</span>=<span class="st">&quot;true&quot;</span><span class="ot"> import</span>=<span class="st">&quot;net.thauvin.erik.httpstatus.Reasons&quot;</span><span class="ot"> </span>%&gt;</a>
<a class="sourceLine" id="cb2-2" title="2">&lt;%= Reasons.getReasonPhrase(pageContext.getErrorData().getStatusCode()) %&gt;</a></code></pre></div>
<div class="sourceCode" id="cb2"><pre class="sourceCode jsp"><code class="sourceCode jsp"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true"></a><span class="bu">&lt;%@ page</span><span class="ot"> isErrorPage</span>=<span class="st">&quot;true&quot;</span><span class="ot"> import</span>=<span class="st">&quot;net.thauvin.erik.httpstatus.Reasons&quot;</span><span class="ot"> </span><span class="bu">%&gt;</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true"></a><span class="pp">&lt;%=</span> Reasons.<span class="fu">getReasonPhrase</span>(pageContext.<span class="fu">getErrorData</span>().<span class="fu">getStatusCode</span>()) <span class="pp">%&gt;</span></span></code></pre></div>
<p>would display on a <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.2">501 status code</a>:</p>
<pre><code>Not Implemented
</code></pre>
<h2 id="usage-with-gradle-or-maven">Usage with <a href="https://gradle.org/">Gradle</a> or <a href="http://maven.apache.org/">Maven</a></h2>
<p>Include the following in your <code>build.gradle</code> file:</p>
<pre class="gradle"><code>dependencies {
implementation &#39;net.thauvin.erik.httpstatus:httpstatus:1.0.6&#39;
}
</code></pre>
<p>or as a Maven artifact:</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode xml"><code class="sourceCode xml"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true"></a><span class="kw">&lt;dependency&gt;</span></span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true"></a> <span class="kw">&lt;groupId&gt;</span>net.thauvin.erik.httpstatus<span class="kw">&lt;/groupId&gt;</span></span>
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true"></a> <span class="kw">&lt;artifactId&gt;</span>httpstatus<span class="kw">&lt;/artifactId&gt;</span></span>
<span id="cb5-4"><a href="#cb5-4" aria-hidden="true"></a> <span class="kw">&lt;version&gt;</span>1.0.6<span class="kw">&lt;/version&gt;</span></span>
<span id="cb5-5"><a href="#cb5-5" aria-hidden="true"></a><span class="kw">&lt;/dependency&gt;</span></span></code></pre></div>
<h2 id="hscause">hs:cause</h2>
<p>The <code>&lt;hs:cause/&gt;</code> tag displays the cause of current HTTP status code, if any. A shorthand for:</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode jsp"><code class="sourceCode jsp"><a class="sourceLine" id="cb4-1" title="1">&lt;%= pageContext.getErrorData().getThrowable().getCause().getLocalizedMessage() %&gt;</a></code></pre></div>
<div class="sourceCode" id="cb6"><pre class="sourceCode jsp"><code class="sourceCode jsp"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true"></a><span class="pp">&lt;%=</span> pageContext.<span class="fu">getErrorData</span>().<span class="fu">getThrowable</span>().<span class="fu">getCause</span>().<span class="fu">getLocalizedMessage</span>() <span class="pp">%&gt;</span></span></code></pre></div>
<p>Optional attributes are:</p>
<table>
<thead>
@ -122,10 +135,10 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
</table>
<h2 id="hscode">hs:code</h2>
<p>The <code>&lt;hs:code/&gt;</code> tag displays the current HTTP status code, if any. A shorthand for:</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode jsp"><code class="sourceCode jsp"><a class="sourceLine" id="cb5-1" title="1">&lt;%= pageContext.getErrorData().getStatusCode() %&gt;</a></code></pre></div>
<div class="sourceCode" id="cb7"><pre class="sourceCode jsp"><code class="sourceCode jsp"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true"></a><span class="pp">&lt;%=</span> pageContext.<span class="fu">getErrorData</span>().<span class="fu">getStatusCode</span>() <span class="pp">%&gt;</span></span></code></pre></div>
<h2 id="hsmessage">hs:message</h2>
<p>The <code>&lt;hs:message/&gt;</code> tag displays the current error message, if any. A shorthand for:</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode jsp"><code class="sourceCode jsp"><a class="sourceLine" id="cb6-1" title="1">&lt;%= request.getAttribute(<span class="st">&quot;javax.servlet.error.message&quot;</span>) %&gt;</a></code></pre></div>
<div class="sourceCode" id="cb8"><pre class="sourceCode jsp"><code class="sourceCode jsp"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true"></a><span class="pp">&lt;%=</span> request.<span class="fu">getAttribute</span>(<span class="st">&quot;javax.servlet.error.message&quot;</span>) <span class="pp">%&gt;</span></span></code></pre></div>
<p>Optional attributes are:</p>
<table>
<thead>
@ -169,6 +182,78 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
</tr>
</tbody>
</table>
<h2 id="statuscode-bean">StatusCode Bean</h2>
<p>The <code>StatusCode</code> bean can be used to check the class of the status code error. For example, using the JSTL:</p>
<div class="sourceCode" id="cb9"><pre class="sourceCode jsp"><code class="sourceCode jsp"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true"></a><span class="bu">&lt;%@ taglib</span><span class="ot"> prefix</span>=<span class="st">&quot;hs&quot;</span><span class="ot"> uri</span>=<span class="st">&quot;http://erik.thauvin.net/taglibs/httpstatus&quot;</span><span class="ot"> </span><span class="bu">%&gt;</span></span>
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true"></a><span class="bu">&lt;%@ taglib</span><span class="ot"> prefix</span>=<span class="st">&quot;c&quot;</span><span class="ot"> uri</span>=<span class="st">&quot;http://java.sun.com/jsp/jstl/core&quot;</span><span class="ot"> </span><span class="bu">%&gt;</span></span>
<span id="cb9-3"><a href="#cb9-3" aria-hidden="true"></a></span>
<span id="cb9-4"><a href="#cb9-4" aria-hidden="true"></a><span class="bu">&lt;jsp:useBean</span><span class="ot"> id</span>=<span class="st">&quot;statusCode&quot;</span><span class="ot"> class</span>=<span class="st">&quot;net.thauvin.erik.httpstatus.StatusCode&quot;</span><span class="bu">/&gt;</span></span>
<span id="cb9-5"><a href="#cb9-5" aria-hidden="true"></a><span class="kw">&lt;c:set</span><span class="ot"> target</span>=<span class="dt">&quot;</span><span class="pp">${</span>statusCode<span class="pp">}</span><span class="dt">&quot;</span><span class="ot"> property</span>=<span class="dt">&quot;code&quot;</span><span class="kw">&gt;&lt;hs:code/&gt;&lt;/c:set&gt;</span></span>
<span id="cb9-6"><a href="#cb9-6" aria-hidden="true"></a><span class="kw">&lt;c:choose&gt;</span></span>
<span id="cb9-7"><a href="#cb9-7" aria-hidden="true"></a> <span class="kw">&lt;c:when</span><span class="ot"> test</span>=<span class="dt">&quot;</span><span class="pp">${</span>statusCode.<span class="fu">isClientError</span>()<span class="pp">}</span><span class="dt">&quot;</span><span class="kw">&gt;</span></span>
<span id="cb9-8"><a href="#cb9-8" aria-hidden="true"></a> An error occurred on your side. (<span class="kw">&lt;hs:reason/&gt;</span>)</span>
<span id="cb9-9"><a href="#cb9-9" aria-hidden="true"></a> <span class="kw">&lt;/c:when&gt;</span></span>
<span id="cb9-10"><a href="#cb9-10" aria-hidden="true"></a> <span class="kw">&lt;c:otherwise&gt;</span></span>
<span id="cb9-11"><a href="#cb9-11" aria-hidden="true"></a> An error occurred on our side. (<span class="kw">&lt;hs:message/&gt;</span>)</span>
<span id="cb9-12"><a href="#cb9-12" aria-hidden="true"></a> <span class="kw">&lt;/c:otherwise&gt;</span></span>
<span id="cb9-13"><a href="#cb9-13" aria-hidden="true"></a><span class="kw">&lt;/c:choose&gt;</span></span></code></pre></div>
<p>or in a Servlet:</p>
<div class="sourceCode" id="cb10"><pre class="sourceCode java"><code class="sourceCode java"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true"></a><span class="kw">import</span><span class="im"> net.thauvin.erik.httpstatus.StatusCode;</span></span>
<span id="cb10-2"><a href="#cb10-2" aria-hidden="true"></a></span>
<span id="cb10-3"><a href="#cb10-3" aria-hidden="true"></a><span class="co">// ---</span></span>
<span id="cb10-4"><a href="#cb10-4" aria-hidden="true"></a></span>
<span id="cb10-5"><a href="#cb10-5" aria-hidden="true"></a>StatusCode statusCode = <span class="kw">new</span> <span class="fu">StatusCode</span>((<span class="bu">Integer</span>) request.<span class="fu">getAttribute</span>(<span class="st">&quot;javax.servlet.error.status_code&quot;</span>));</span>
<span id="cb10-6"><a href="#cb10-6" aria-hidden="true"></a><span class="kw">if</span> (statusCode.<span class="fu">isError</span>()) {</span>
<span id="cb10-7"><a href="#cb10-7" aria-hidden="true"></a> <span class="kw">if</span> (statusCode.<span class="fu">isServerError</span>()) {</span>
<span id="cb10-8"><a href="#cb10-8" aria-hidden="true"></a> <span class="bu">String</span> reason = statusCode.<span class="fu">getReason</span>();</span>
<span id="cb10-9"><a href="#cb10-9" aria-hidden="true"></a> } <span class="kw">else</span> {</span>
<span id="cb10-10"><a href="#cb10-10" aria-hidden="true"></a> <span class="co">// ...</span></span>
<span id="cb10-11"><a href="#cb10-11" aria-hidden="true"></a> }</span>
<span id="cb10-12"><a href="#cb10-12" aria-hidden="true"></a>}</span></code></pre></div>
<p>The <code>StatusCode</code> bean methods are:</p>
<table>
<thead>
<tr class="header">
<th>Method</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><code>getReason</code></td>
<td>Returns the reason for the status code (eg: <code>Internal Server Error</code>)</td>
</tr>
<tr class="even">
<td><code>isClientError</code></td>
<td>Checks if the status code is a client error.</td>
</tr>
<tr class="odd">
<td><code>isError</code></td>
<td>Checks if the status code is a server or client error.</td>
</tr>
<tr class="even">
<td><code>isInfo</code></td>
<td>Checks if the status code is informational.</td>
</tr>
<tr class="odd">
<td><code>isRedirect</code></td>
<td>Checks if the status code is a redirect.</td>
</tr>
<tr class="even">
<td><code>isServerError</code></td>
<td>Checks if the status code is a server error.</td>
</tr>
<tr class="odd">
<td><code>isSuccess</code></td>
<td>Checks if the status code is a success. (<code>OK</code>)</td>
</tr>
<tr class="even">
<td><code>isValid</code></td>
<td>Checks if the status code is valid.</td>
</tr>
</tbody>
</table>
<h2 id="reasons">Reasons</h2>
<p>The reasons are defined in a <a href="http://docs.oracle.com/javase/8/docs/api/java/util/ResourceBundle.html">ResourceBundle</a> properties as follows:</p>
<table>
<thead>
@ -544,39 +629,27 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
</tr>
</tbody>
</table>
<h2 id="usage-with-gradle-or-maven">Usage with <a href="https://gradle.org/">Gradle</a> or <a href="http://maven.apache.org/">Maven</a></h2>
<p>Include the following in your <code>build.gradle</code> file:</p>
<pre class="gradle"><code>dependencies {
implementation &#39;net.thauvin.erik.httpstatus:httpstatus:1.0.6&#39;
}
</code></pre>
<p>or as a Maven artifact:</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode xml"><code class="sourceCode xml"><a class="sourceLine" id="cb8-1" title="1"><span class="kw">&lt;dependency&gt;</span></a>
<a class="sourceLine" id="cb8-2" title="2"> <span class="kw">&lt;groupId&gt;</span>net.thauvin.erik.httpstatus<span class="kw">&lt;/groupId&gt;</span></a>
<a class="sourceLine" id="cb8-3" title="3"> <span class="kw">&lt;artifactId&gt;</span>httpstatus<span class="kw">&lt;/artifactId&gt;</span></a>
<a class="sourceLine" id="cb8-4" title="4"> <span class="kw">&lt;version&gt;</span>1.0.6<span class="kw">&lt;/version&gt;</span></a>
<a class="sourceLine" id="cb8-5" title="5"><span class="kw">&lt;/dependency&gt;</span></a></code></pre></div>
<h2 id="command-line-usage">Command Line Usage</h2>
<p>You can query the reason phrase for status codes as follows:</p>
<div class="sourceCode" id="cb9"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb9-1" title="1">$ <span class="ex">java</span> -jar httpstatus-1.0.6.jar 404 500</a>
<a class="sourceLine" id="cb9-2" title="2"><span class="ex">404</span>: Not Found</a>
<a class="sourceLine" id="cb9-3" title="3"><span class="ex">500</span>: Internal Server Error</a></code></pre></div>
<div class="sourceCode" id="cb11"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true"></a>$ <span class="ex">java</span> -jar httpstatus-1.0.6.jar 404 500</span>
<span id="cb11-2"><a href="#cb11-2" aria-hidden="true"></a><span class="ex">404</span>: Not Found</span>
<span id="cb11-3"><a href="#cb11-3" aria-hidden="true"></a><span class="ex">500</span>: Internal Server Error</span></code></pre></div>
<p>If no status code is specified, all will be printed:</p>
<div class="sourceCode" id="cb10"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb10-1" title="1">$ <span class="ex">java</span> -jar httpstatus-1.0.6.jar</a>
<a class="sourceLine" id="cb10-2" title="2"><span class="ex">100</span>: Continue</a>
<a class="sourceLine" id="cb10-3" title="3"><span class="ex">101</span>: Switching Protocols</a>
<a class="sourceLine" id="cb10-4" title="4"><span class="ex">102</span>: Processing</a>
<a class="sourceLine" id="cb10-5" title="5"><span class="ex">103</span>: Early Hints</a>
<a class="sourceLine" id="cb10-6" title="6"><span class="ex">200</span>: OK</a>
<a class="sourceLine" id="cb10-7" title="7"><span class="ex">201</span>: Created</a>
<a class="sourceLine" id="cb10-8" title="8"><span class="ex">202</span>: Accepted</a>
<a class="sourceLine" id="cb10-9" title="9"><span class="ex">203</span>: Non-Authoritative Information</a>
<a class="sourceLine" id="cb10-10" title="10"><span class="ex">204</span>: No Content</a>
<a class="sourceLine" id="cb10-11" title="11"><span class="ex">205</span>: Reset Content</a>
<a class="sourceLine" id="cb10-12" title="12"><span class="ex">206</span>: Partial Content</a>
<a class="sourceLine" id="cb10-13" title="13"><span class="ex">207</span>: Multi-Status</a>
<a class="sourceLine" id="cb10-14" title="14"><span class="ex">208</span>: Already Reported</a>
<a class="sourceLine" id="cb10-15" title="15"><span class="ex">226</span>: IM Used</a>
<a class="sourceLine" id="cb10-16" title="16"><span class="ex">...</span></a></code></pre></div>
<div class="sourceCode" id="cb12"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true"></a>$ <span class="ex">java</span> -jar httpstatus-1.0.6.jar</span>
<span id="cb12-2"><a href="#cb12-2" aria-hidden="true"></a><span class="ex">100</span>: Continue</span>
<span id="cb12-3"><a href="#cb12-3" aria-hidden="true"></a><span class="ex">101</span>: Switching Protocols</span>
<span id="cb12-4"><a href="#cb12-4" aria-hidden="true"></a><span class="ex">102</span>: Processing</span>
<span id="cb12-5"><a href="#cb12-5" aria-hidden="true"></a><span class="ex">103</span>: Early Hints</span>
<span id="cb12-6"><a href="#cb12-6" aria-hidden="true"></a><span class="ex">200</span>: OK</span>
<span id="cb12-7"><a href="#cb12-7" aria-hidden="true"></a><span class="ex">201</span>: Created</span>
<span id="cb12-8"><a href="#cb12-8" aria-hidden="true"></a><span class="ex">202</span>: Accepted</span>
<span id="cb12-9"><a href="#cb12-9" aria-hidden="true"></a><span class="ex">203</span>: Non-Authoritative Information</span>
<span id="cb12-10"><a href="#cb12-10" aria-hidden="true"></a><span class="ex">204</span>: No Content</span>
<span id="cb12-11"><a href="#cb12-11" aria-hidden="true"></a><span class="ex">205</span>: Reset Content</span>
<span id="cb12-12"><a href="#cb12-12" aria-hidden="true"></a><span class="ex">206</span>: Partial Content</span>
<span id="cb12-13"><a href="#cb12-13" aria-hidden="true"></a><span class="ex">207</span>: Multi-Status</span>
<span id="cb12-14"><a href="#cb12-14" aria-hidden="true"></a><span class="ex">208</span>: Already Reported</span>
<span id="cb12-15"><a href="#cb12-15" aria-hidden="true"></a><span class="ex">226</span>: IM Used</span>
<span id="cb12-16"><a href="#cb12-16" aria-hidden="true"></a><span class="ex">...</span></span></code></pre></div>
</body>
</html>

Binary file not shown.

View file

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

269
gradlew vendored
View file

@ -1,7 +1,7 @@
#!/usr/bin/env sh
#!/bin/sh
#
# Copyright 2015 the original author or authors.
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -17,67 +17,101 @@
#
##############################################################################
##
## Gradle start up script for UN*X
##
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
APP_BASE_NAME=${0##*/}
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
MAX_FD=maximum
warn () {
echo "$*"
}
} >&2
die () {
echo
echo "$*"
echo
exit 1
}
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD="$JAVA_HOME/bin/java"
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@ -98,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
@ -106,80 +140,95 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"