git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/branches/common/common-jaxrs-client/1.0@176575 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
9681f66694
commit
eb500fa88c
|
@ -27,7 +27,7 @@
|
|||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.source=1.7
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -3,7 +3,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.gcube.common</groupId>
|
||||
<artifactId>common-jaxrs-client</artifactId>
|
||||
<version>1.0.2-SNAPSHOT</version>
|
||||
<version>1.0.3-SNAPSHOT</version>
|
||||
<name>gcube-jaxrs-client</name>
|
||||
|
||||
<parent>
|
||||
|
|
|
@ -29,23 +29,14 @@ public class TargetFactory implements TargetFactoryDSL.AtClause{
|
|||
public GXWebTargetAdapterRequest getAsGxRest(String address) {
|
||||
|
||||
try{
|
||||
|
||||
|
||||
/*
|
||||
String resourceAddress = address.substring(0, address.indexOf("/service"));
|
||||
|
||||
WebTarget resourcetarget = client.target(resourceAddress).path("/resource/");
|
||||
GXWebTargetAdapterRequest webTarget = null;
|
||||
if (address.startsWith("https")) {
|
||||
log.info("using secure call");
|
||||
webTarget = GXWebTargetAdapterRequest.newHTTPSRequest(address).path(target.path());
|
||||
} else webTarget = GXWebTargetAdapterRequest.newRequest(address).path(target.path());
|
||||
|
||||
int status = resourcetarget.request().get().getStatus();
|
||||
|
||||
if (status!=200)
|
||||
throw new Exception();*/
|
||||
|
||||
//WebTarget webTarget = client.target(address).path(target.path());
|
||||
|
||||
|
||||
|
||||
GXWebTargetAdapterRequest webTarget = GXWebTargetAdapterRequest.newRequest(address).path(target.path());
|
||||
|
||||
|
||||
webTarget.configProperty(ClientProperties.REQUEST_ENTITY_PROCESSING, "CHUNKED");
|
||||
|
||||
|
@ -64,6 +55,7 @@ public class TargetFactory implements TargetFactoryDSL.AtClause{
|
|||
|
||||
try{
|
||||
|
||||
|
||||
Client client = ClientBuilder.newClient()
|
||||
.property(ClientProperties.FOLLOW_REDIRECTS, Boolean.FALSE)
|
||||
.property(ClientProperties.CHUNKED_ENCODING_SIZE, 1024*1024).property(ClientProperties.OUTBOUND_CONTENT_LENGTH_BUFFER, -1)
|
||||
|
@ -88,5 +80,6 @@ public class TargetFactory implements TargetFactoryDSL.AtClause{
|
|||
return at(new JaxRSEndpointReference(endpoint).address);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue