Advertisement
Guest User

Untitled

a guest
May 31st, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. public class VertxRequestParams extends AbstractRequestParams {
  2. private final RoutingContext ctx;
  3.  
  4. public VertxRequestParams(RoutingContext ctx) {
  5. this.ctx = ctx;
  6. }
  7.  
  8. @Override
  9. public Iterable<String> getParamNames() {
  10. return ctx.request().params().names();
  11. }
  12.  
  13. @Override
  14. public String[] getParamValues(String paramName) {
  15. if (!ctx.request().params().contains(paramName)) {
  16. return null;
  17. }
  18.  
  19. List<String> d = ctx.request().params().getAll(paramName);
  20. String[] str = new String[d.size()];
  21.  
  22. for (int i = 0; i < d.size(); i++) {
  23. str[i] = d.get(i);
  24. }
  25.  
  26. return str;
  27. }
  28.  
  29. @Override
  30. public UploadedFile[] getUploadedFiles(String paramName) {
  31. return new UploadedFile[0];
  32. }
  33.  
  34. @Override
  35. public RequestProcessingError getRequestError() {
  36. return null;
  37. }
  38.  
  39. public RoutingContext getRoutingContext() {
  40. return this.ctx;
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement