Alon Bar-Lev has posted comments on this change. Change subject: uutils: Extract connectionBuilder class ......................................................................
Patch Set 6: (2 comments) http://gerrit.ovirt.org/#/c/33479/6/backend/manager/modules/uutils/src/main/java/org/ovirt/engine/core/uutils/http/ConnectionBuilder.java File backend/manager/modules/uutils/src/main/java/org/ovirt/engine/core/uutils/http/ConnectionBuilder.java: Line 96: Line 97: Line 98: public HttpURLConnection create() throws IOException, GeneralSecurityException { Line 99: URLConnection connection = new URL(url).openConnection(); Line 100: if (!(connection instanceof HttpsURLConnection)) { why create an instance first and not check the protocol within the URL before openConnection()? you can also check this earlier when setURL Line 101: throw new RuntimeException("The connection is not an HTTP or HTTPS connection"); Line 102: } Line 103: connection.setAllowUserInteraction(false); Line 104: connection.setUseCaches(false); http://gerrit.ovirt.org/#/c/33479/6/backend/manager/modules/uutils/src/main/java/org/ovirt/engine/core/uutils/servlet/ProxyServletBase.java File backend/manager/modules/uutils/src/main/java/org/ovirt/engine/core/uutils/servlet/ProxyServletBase.java: Line 142: try { Line 143: connection = create(new URL(mergeQuery(url, request.getQueryString()))); Line 144: connection.setDoInput(true); Line 145: connection.setDoOutput(false); Line 146: } catch (Exception e) { you can encapsulate the entire bellow section within this try block. Line 147: throw new ServletException(e); Line 148: } Line 149: connection.connect(); Line 150: try { -- To view, visit http://gerrit.ovirt.org/33479 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I85ea4e7301b3a018b0438fff25cefad80ebd7256 Gerrit-PatchSet: 6 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com> Gerrit-Reviewer: Moti Asayag <masa...@redhat.com> Gerrit-Reviewer: Oved Ourfali <oourf...@redhat.com> Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches