File tree Expand file tree Collapse file tree
src/main/java/io/github/intisy/utils/custom Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,5 +14,6 @@ online {
1414
1515dependencies {
1616 githubImplementation ' intisy:simple-logger:1.14'
17+ implementation ' org.apache.httpcomponents:httpclient:4.5.14'
1718 implementation " org.kohsuke:github-api:1.99"
1819}
Original file line number Diff line number Diff line change 1+ package io .github .intisy .utils .custom ;
2+
3+ import org .apache .http .client .methods .HttpEntityEnclosingRequestBase ;
4+ import java .net .URI ;
5+
6+ public class HttpDeleteWithBody extends HttpEntityEnclosingRequestBase {
7+
8+ public static final String METHOD_NAME = "DELETE" ;
9+
10+ public HttpDeleteWithBody () {
11+ super ();
12+ }
13+
14+ public HttpDeleteWithBody (final URI uri ) {
15+ super ();
16+ setURI (uri );
17+ }
18+
19+ public HttpDeleteWithBody (final String uri ) {
20+ super ();
21+ setURI (URI .create (uri ));
22+ }
23+
24+ @ Override
25+ public String getMethod () {
26+ return METHOD_NAME ;
27+ }
28+ }
Original file line number Diff line number Diff line change 1+ package io .github .intisy .utils .custom ;
2+
3+ import java .util .concurrent .locks .Condition ;
4+ import java .util .concurrent .locks .Lock ;
5+ import java .util .concurrent .locks .ReentrantLock ;
6+
7+ public class Wait {
8+ private final Lock lock = new ReentrantLock ();
9+ private final Condition condition = lock .newCondition ();
10+ private boolean variable = false ;
11+
12+ public void waitForVariable (boolean variable ) throws InterruptedException {
13+ lock .lock ();
14+ try {
15+ while (this .variable != variable ) {
16+ condition .await ();
17+ }
18+ } finally {
19+ lock .unlock ();
20+ }
21+ }
22+
23+ public void setVariable (boolean value ) {
24+ lock .lock ();
25+ try {
26+ variable = value ;
27+ condition .signalAll ();
28+ } finally {
29+ lock .unlock ();
30+ }
31+ }
32+ public boolean getVariable () {
33+ return variable ;
34+ }
35+ }
You can’t perform that action at this time.
0 commit comments