Skip to content

Commit

Permalink
Minor code cleanup
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.java.net/svn/glassfish~svn/trunk/main@50693 6f3ba3e3-413c-0410-a8aa-90bee3ab43b5
  • Loading branch information
jdlee committed Nov 7, 2011
1 parent 1b12934 commit 3dbe9ab
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.security.auth.message.AuthException;
import javax.servlet.RequestDispatcher;
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.WebResource;
Expand Down Expand Up @@ -82,6 +80,7 @@
import com.sun.enterprise.security.SecurityServicesUtil;
import com.sun.enterprise.config.serverbeans.SecureAdmin;
import com.sun.enterprise.security.ssl.SSLUtils;
import com.sun.jersey.api.client.filter.CsrfProtectionFilter;
import com.sun.jersey.client.urlconnection.HTTPSProperties;
import org.jvnet.hk2.component.Habitat;

Expand Down Expand Up @@ -283,7 +282,6 @@ public static Map<String, Object> getEntityAttrs(String endpoint, String key) {
return valueMap;
}


private static String getMessage(Map aMap){
String message = "";
if (aMap != null){
Expand Down Expand Up @@ -398,7 +396,6 @@ public static Map<String, Object> parseResponse(RestResponse response, HandlerCo
return null;
}


public static boolean hasWarning(Map responseMap){
if (responseMap.get("data") != null){
String exitCodeStr = (String)((Map)responseMap.get("data")).get("exit_code");
Expand Down Expand Up @@ -781,7 +778,7 @@ public static void checkStatusForSuccess(ClientResponse cr) {
//******************************************************************************************************************
// Jersey client methods
//******************************************************************************************************************
public static void initialize(Client client){
public static void initialize(Client client){
if (client == null){
client = JERSEY_CLIENT;
}
Expand All @@ -791,6 +788,7 @@ public static void initialize(Client client){
HTTPSProperties httpsProperties = new HTTPSProperties(new BasicHostnameVerifier(),
habitat.getComponent(SSLUtils.class).getAdminSSLContext(SecureAdmin.Util.DASAlias(secureAdmin), null ));
client.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES, httpsProperties);
client.addFilter(new CsrfProtectionFilter());
}catch(Exception ex){
GuiUtil.getLogger().warning("RestUtil.initialize() failed");
if (GuiUtil.getLogger().isLoggable(Level.FINE)){
Expand Down

0 comments on commit 3dbe9ab

Please sign in to comment.