Lior Vernia has posted comments on this change.

Change subject: webadmin: Added validation to ProviderModel
......................................................................


Patch Set 5: (4 inline comments)

....................................................
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/UriAuthority.java
Line 4: import com.google.gwt.regexp.shared.RegExp;
Line 5: 
Line 6: public class UriAuthority {
Line 7: 
Line 8:     private static final RegExp PATTERN_AUTHORITY = 
RegExp.compile("^([^:]*)(?::(.*))?$", "i"); //$NON-NLS-1$ $NON-NLS-2$
Done
Line 9: 
Line 10:     private boolean valid;
Line 11:     private String host;
Line 12:     private String port;


Line 20:         }
Line 21:     }
Line 22: 
Line 23:     @Override
Line 24:     public String toString() {
Correct, fixed as described in my response for Uri.
Line 25:         String authority = new String();
Line 26:         authority += host;
Line 27:         if (!port.isEmpty()) {
Line 28:             authority += ':' + port;


....................................................
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Uri.java
Line 34:         }
Line 35:     }
Line 36: 
Line 37:     @Override
Line 38:     public String toString() {
Correct, well-spotted. I changed this and UriAuthority to adhere to a slightly 
different contract now, which is more self-consistent - null is returned 
whenever they're invalid, both in toString() and in getters.
Line 39:         String uri = new String();
Line 40:         if (!scheme.isEmpty()) {
Line 41:             uri += scheme + "://"; //$NON-NLS-1$
Line 42:         }


....................................................
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/validation/UrlValidation.java
Line 16:             return res;
Line 17:         }
Line 18: 
Line 19:         res = 
getHostValidation().validate(uri.getAuthority().getHost());
Line 20:         if (!uri.getScheme().equalsIgnoreCase(Uri.SCHEME_HTTP)) {
Done
Line 21:             res.setSuccess(false);
Line 22:             res.getReasons().add(getSchemeMessage());
Line 23:         }
Line 24:         return res;


--
To view, visit http://gerrit.ovirt.org/14695
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I754a7ce4e2aa719b0284d2dc0021822af2629b07
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Lior Vernia <[email protected]>
Gerrit-Reviewer: Alona Kaplan <[email protected]>
Gerrit-Reviewer: Lior Vernia <[email protected]>
Gerrit-Reviewer: Oved Ourfali <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to