Tabnine Logo
HttpRequest.getParamAsInteger
Code IndexAdd Tabnine to your IDE (free)

How to use
getParamAsInteger
method
in
org.apache.shindig.gadgets.http.HttpRequest

Best Java code snippets using org.apache.shindig.gadgets.http.HttpRequest.getParamAsInteger (Showing top 8 results out of 315)

origin: org.apache.shindig/shindig-gadgets

/**
 * Predicate check for validating the Image Resizing step. Images with improper resize parameters
 * specified are not fit for resize.
 *
 * @param request the HTTP request.
 * @param response the HTTP response for the original image fetched.
 * @param imageInfo the image information extracted via Apache's Sanselan APIs.
 * @return true if the specified image can be rewriten; else it's set to false.
 */
private Boolean isResizeRequested(HttpRequest request, HttpResponseBuilder response,
  ImageInfo imageInfo) {
 Integer requestedWidth = request.getParamAsInteger(PARAM_RESIZE_WIDTH);
 Integer requestedHeight = request.getParamAsInteger(PARAM_RESIZE_HEIGHT);
 boolean resizeRequested = ((requestedWidth != null) && isUsableParameter(requestedWidth) ||
               (requestedHeight != null) && isUsableParameter(requestedHeight));
 boolean noExpand = "1".equals(request.getParam(PARAM_NO_EXPAND));
 if (noExpand &&
   (requestedHeight == null || imageInfo.getHeight() <= requestedHeight) &&
   (requestedWidth == null || imageInfo.getWidth() <= requestedWidth)) {
  // Don't do anything, since the current image fits within the bounding area.
  resizeRequested = false;
 }
 return resizeRequested;
}
origin: org.apache.shindig/shindig-gadgets

int widthDelta = 0;
int heightDelta = 0;
Integer requestedWidth = request.getParamAsInteger(PARAM_RESIZE_WIDTH);
Integer requestedHeight = request.getParamAsInteger(PARAM_RESIZE_HEIGHT);
origin: com.lmco.shindig/shindig-gadgets

private HttpRequest getMockRequest(Integer width, Integer height, Integer quality, boolean noExpand) {
 HttpRequest request = mockControl.createMock(HttpRequest.class);
 expect(request.getUri()).andReturn(IMAGE_URL);
 expect(request.getParamAsInteger(Param.RESIZE_QUALITY.getKey())).andReturn(quality);
 expect(request.getParamAsInteger(Param.RESIZE_WIDTH.getKey())).andReturn(width);
 expect(request.getParamAsInteger(Param.RESIZE_HEIGHT.getKey())).andReturn(height);
 expect(request.getParam(Param.NO_EXPAND.getKey())).andReturn(noExpand ? "1" : null).anyTimes();
 return request;
}
origin: org.apache.shindig/shindig-gadgets

private HttpRequest getMockRequest(Integer width, Integer height, Integer quality, boolean noExpand) {
 HttpRequest request = mockControl.createMock(HttpRequest.class);
 expect(request.getUri()).andReturn(IMAGE_URL).anyTimes();
 expect(request.getParamAsInteger(Param.RESIZE_QUALITY.getKey())).andReturn(quality).anyTimes();
 expect(request.getParamAsInteger(Param.RESIZE_WIDTH.getKey())).andReturn(width).anyTimes();
 expect(request.getParamAsInteger(Param.RESIZE_HEIGHT.getKey())).andReturn(height).anyTimes();
 expect(request.getParam(Param.NO_EXPAND.getKey())).andReturn(noExpand ? "1" : null).anyTimes();
 return request;
}
origin: org.wso2.org.apache.shindig/shindig-gadgets

private HttpRequest getMockRequest(Integer width, Integer height, Integer quality, boolean noExpand) {
 HttpRequest request = mockControl.createMock(HttpRequest.class);
 expect(request.getUri()).andReturn(IMAGE_URL).anyTimes();
 expect(request.getParamAsInteger(Param.RESIZE_QUALITY.getKey())).andReturn(quality).anyTimes();
 expect(request.getParamAsInteger(Param.RESIZE_WIDTH.getKey())).andReturn(width).anyTimes();
 expect(request.getParamAsInteger(Param.RESIZE_HEIGHT.getKey())).andReturn(height).anyTimes();
 expect(request.getParam(Param.NO_EXPAND.getKey())).andReturn(noExpand ? "1" : null).anyTimes();
 return request;
}
origin: org.apache.shindig/shindig-gadgets

Integer resizeQuality = request.getParamAsInteger(PARAM_RESIZE_QUALITY);
Integer requestedWidth = request.getParamAsInteger(PARAM_RESIZE_WIDTH);
Integer requestedHeight = request.getParamAsInteger(PARAM_RESIZE_HEIGHT);
if (!isUsableParameter(requestedWidth) || !isUsableParameter(requestedHeight) ||
  !isUsableParameter(resizeQuality)) {
origin: org.gatein.shindig/shindig-gadgets

Integer resizeQuality = request.getParamAsInteger(PARAM_RESIZE_QUALITY);
Integer requestedWidth = request.getParamAsInteger(PARAM_RESIZE_WIDTH);
Integer requestedHeight = request.getParamAsInteger(PARAM_RESIZE_HEIGHT);
boolean isResizeRequested = (requestedWidth != null || requestedHeight != null);
origin: com.lmco.shindig/shindig-gadgets

Integer resizeQuality = request.getParamAsInteger(PARAM_RESIZE_QUALITY);
Integer requestedWidth = request.getParamAsInteger(PARAM_RESIZE_WIDTH);
Integer requestedHeight = request.getParamAsInteger(PARAM_RESIZE_HEIGHT);
boolean isResizeRequested = (requestedWidth != null || requestedHeight != null);
org.apache.shindig.gadgets.httpHttpRequestgetParamAsInteger

Popular methods of HttpRequest

  • <init>
    Clone an existing HttpRequest.
  • addHeader
    Add a single header to the request. If a value for the given name is already set, a second value is
  • getAuthType
  • getCacheTtl
  • getContainer
  • getFollowRedirects
  • getGadget
  • getHeader
  • getHeaders
  • getIgnoreCache
  • getMethod
  • getOAuthArguments
  • getMethod,
  • getOAuthArguments,
  • getParam,
  • getPostBody,
  • getPostBodyAsString,
  • getPostBodyLength,
  • getRewriteMimeType,
  • getSecurityToken,
  • getUri

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSupportFragmentManager (FragmentActivity)
  • getResourceAsStream (ClassLoader)
  • getExternalFilesDir (Context)
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Reference (javax.naming)
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • JLabel (javax.swing)
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now