Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ee9' of https://github.com/resteasy/Resteasy into xJun7…
…-upstream-ee9
- Loading branch information
Showing
5 changed files
with
200 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
...asy-core/src/main/java/org/jboss/resteasy/specimpl/BootstrapConfigurationBuilderImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
package org.jboss.resteasy.specimpl; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.Objects; | ||
import java.util.Optional; | ||
import java.util.function.BiFunction; | ||
|
||
import javax.net.ssl.SSLContext; | ||
|
||
import jakarta.ws.rs.SeBootstrap; | ||
|
||
public class BootstrapConfigurationBuilderImpl implements SeBootstrap.Configuration.Builder { | ||
private Map<String, Object> properties = new HashMap<String, Object>(); | ||
@SuppressWarnings("rawtypes") | ||
private BiFunction propertiesProvider; | ||
|
||
@Override | ||
public SeBootstrap.Configuration build() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public SeBootstrap.Configuration.Builder property(String name, Object value) { | ||
properties.put(name, value); | ||
return this; | ||
} | ||
|
||
@Override | ||
public SeBootstrap.Configuration.Builder protocol(String protocol) { | ||
return SeBootstrap.Configuration.Builder.super.protocol(protocol); | ||
} | ||
|
||
@Override | ||
public SeBootstrap.Configuration.Builder host(String host) { | ||
return SeBootstrap.Configuration.Builder.super.host(host); | ||
} | ||
|
||
@Override | ||
public SeBootstrap.Configuration.Builder port(Integer port) { | ||
return SeBootstrap.Configuration.Builder.super.port(port); | ||
} | ||
|
||
@Override | ||
public SeBootstrap.Configuration.Builder rootPath(String rootPath) { | ||
return SeBootstrap.Configuration.Builder.super.rootPath(rootPath); | ||
} | ||
|
||
@Override public SeBootstrap.Configuration.Builder sslContext(SSLContext sslContext) { | ||
return SeBootstrap.Configuration.Builder.super.sslContext(sslContext); | ||
} | ||
|
||
@Override | ||
public SeBootstrap.Configuration.Builder sslClientAuthentication( | ||
SeBootstrap.Configuration.SSLClientAuthentication sslClientAuthentication) { | ||
return SeBootstrap.Configuration.Builder.super.sslClientAuthentication(sslClientAuthentication); | ||
} | ||
|
||
@Override | ||
public <T> SeBootstrap.Configuration.Builder from(BiFunction<String, Class<T>, Optional<T>> propertiesProvider) { | ||
Objects.requireNonNull(propertiesProvider); | ||
this.propertiesProvider = propertiesProvider; | ||
return this; | ||
} | ||
|
||
@Override | ||
public SeBootstrap.Configuration.Builder from(Object externalConfig) { | ||
return SeBootstrap.Configuration.Builder.super.from(externalConfig); | ||
} | ||
private class ServerConfiguration implements jakarta.ws.rs.SeBootstrap.Configuration { | ||
@Override | ||
@SuppressWarnings({"rawtypes", "unchecked"}) | ||
public Object property(String name) | ||
{ | ||
Object result = properties.get(name); | ||
if (result == null && propertiesProvider != null) | ||
{ | ||
result = propertiesProvider.apply(name, Object.class); | ||
return ((Optional)result).isPresent() ? ((Optional)result).get() : null; | ||
} | ||
return result; | ||
} | ||
} | ||
|
||
} |
61 changes: 61 additions & 0 deletions
61
resteasy-core/src/main/java/org/jboss/resteasy/specimpl/EntityPartBuilderImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package org.jboss.resteasy.specimpl; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
|
||
import jakarta.ws.rs.WebApplicationException; | ||
import jakarta.ws.rs.core.EntityPart; | ||
import jakarta.ws.rs.core.GenericType; | ||
import jakarta.ws.rs.core.MediaType; | ||
import jakarta.ws.rs.core.MultivaluedMap; | ||
|
||
public class EntityPartBuilderImpl implements EntityPart.Builder{ | ||
private String part; | ||
public EntityPartBuilderImpl(final String part) { | ||
this.part = part; | ||
} | ||
@Override | ||
public EntityPart.Builder mediaType(MediaType mediaType) throws IllegalArgumentException { | ||
return null; | ||
} | ||
|
||
@Override | ||
public EntityPart.Builder mediaType(String mediaTypeString) throws IllegalArgumentException { | ||
return null; | ||
} | ||
|
||
@Override | ||
public EntityPart.Builder header(String headerName, String... headerValues) throws IllegalArgumentException { | ||
return null; | ||
} | ||
|
||
@Override | ||
public EntityPart.Builder headers(MultivaluedMap<String, String> newHeaders) throws IllegalArgumentException { | ||
return null; | ||
} | ||
|
||
@Override | ||
public EntityPart.Builder fileName(String fileName) throws IllegalArgumentException { | ||
return null; | ||
} | ||
|
||
@Override | ||
public EntityPart.Builder content(InputStream content) throws IllegalArgumentException { | ||
return null; | ||
} | ||
|
||
@Override | ||
public <T> EntityPart.Builder content(T content, Class<? extends T> type) throws IllegalArgumentException { | ||
return null; | ||
} | ||
|
||
@Override | ||
public <T> EntityPart.Builder content(T content, GenericType<T> type) throws IllegalArgumentException { | ||
return null; | ||
} | ||
|
||
@Override | ||
public EntityPart build() throws IllegalStateException, IOException, WebApplicationException { | ||
return null; | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
resteasy-core/src/main/java/org/jboss/resteasy/specimpl/EntityPartImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package org.jboss.resteasy.specimpl; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.util.Optional; | ||
|
||
import jakarta.ws.rs.WebApplicationException; | ||
import jakarta.ws.rs.core.EntityPart; | ||
import jakarta.ws.rs.core.GenericType; | ||
import jakarta.ws.rs.core.MediaType; | ||
import jakarta.ws.rs.core.MultivaluedMap; | ||
//TODO: 3.1 implementation | ||
public class EntityPartImpl implements EntityPart { | ||
@Override | ||
public String getName() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public Optional<String> getFileName() { | ||
return Optional.empty(); | ||
} | ||
|
||
@Override | ||
public InputStream getContent() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public <T> T getContent(Class<T> type) | ||
throws IllegalArgumentException, IllegalStateException, IOException, WebApplicationException { | ||
return null; | ||
} | ||
|
||
@Override | ||
public <T> T getContent(GenericType<T> type) | ||
throws IllegalArgumentException, IllegalStateException, IOException, WebApplicationException { | ||
return null; | ||
} | ||
|
||
@Override | ||
public MultivaluedMap<String, String> getHeaders() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public MediaType getMediaType() { | ||
return null; | ||
} | ||
} |