Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 package com.facebook.presto.server;
 
 
 
 import java.util.Map;
 
 import static com.google.common.base.Preconditions.checkNotNull;
 import static java.util.Collections.emptyEnumeration;
 import static java.util.Collections.enumeration;
 
 public class MockHttpServletRequest
         implements HttpServletRequest
 {
     private final ListMultimap<StringStringheaders;
     private final String remoteAddress;
 
     public MockHttpServletRequest(ListMultimap<StringStringheadersString remoteAddress)
     {
         this. = ImmutableListMultimap.copyOf(checkNotNull(headers"headers is null"));
         this. = checkNotNull(remoteAddress"remoteAddress is null");
     }
 
     @Override
     public String getAuthType()
     {
         throw new UnsupportedOperationException();
     }
 
     @Override
     public Cookie[] getCookies()
     {
         throw new UnsupportedOperationException();
     }
 
     @Override
     public long getDateHeader(String name)
     {
         throw new UnsupportedOperationException();
     }
 
     @Override
     public String getHeader(String name)
     {
         Enumeration<Stringheaders = getHeaders(name);
         return headers.hasMoreElements() ? headers.nextElement() : null;
     }
 
     @Override
     public Enumeration<StringgetHeaders(String name)
     {
         for (Map.Entry<StringCollection<String>> entry : .asMap().entrySet()) {
             if (entry.getKey().equalsIgnoreCase(name)) {
                 return enumeration(entry.getValue());
             }
         }
         return emptyEnumeration();
     }
 
     @Override
     public Enumeration<StringgetHeaderNames()
     {
         return enumeration(.keySet());
     }
    @Override
    public int getIntHeader(String name)
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public String getMethod()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public String getPathInfo()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public String getPathTranslated()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public String getContextPath()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public String getQueryString()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public String getRemoteUser()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public boolean isUserInRole(String role)
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public Principal getUserPrincipal()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public String getRequestedSessionId()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public String getRequestURI()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public StringBuffer getRequestURL()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public String getServletPath()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public HttpSession getSession(boolean create)
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public HttpSession getSession()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public String changeSessionId()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public boolean isRequestedSessionIdValid()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public boolean isRequestedSessionIdFromCookie()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public boolean isRequestedSessionIdFromURL()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public boolean isRequestedSessionIdFromUrl()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public boolean authenticate(HttpServletResponse response)
            throws IOExceptionServletException
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public void login(String usernameString password)
            throws ServletException
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public void logout()
            throws ServletException
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public Collection<PartgetParts()
            throws IOExceptionServletException
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public Part getPart(String name)
            throws IOExceptionServletException
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public <T extends HttpUpgradeHandler> T upgrade(Class<T> handlerClass)
            throws IOExceptionServletException
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public Object getAttribute(String name)
    {
        throw new UnsupportedOperationException();
    }
    @Override
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public String getCharacterEncoding()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public void setCharacterEncoding(String env)
            throws UnsupportedEncodingException
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public int getContentLength()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public long getContentLengthLong()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public String getContentType()
    {
        throw new UnsupportedOperationException();
    }
    @Override
            throws IOException
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public String getParameter(String name)
    {
        throw new UnsupportedOperationException();
    }
    @Override
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public String[] getParameterValues(String name)
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public Map<StringString[]> getParameterMap()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public String getProtocol()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public String getScheme()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public String getServerName()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public int getServerPort()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public BufferedReader getReader()
            throws IOException
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public String getRemoteAddr()
    {
        return ;
    }
    @Override
    public String getRemoteHost()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public void setAttribute(String nameObject o)
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public void removeAttribute(String name)
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public Locale getLocale()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public Enumeration<LocalegetLocales()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public boolean isSecure()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public String getRealPath(String path)
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public int getRemotePort()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public String getLocalName()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public String getLocalAddr()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public int getLocalPort()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public AsyncContext startAsync()
            throws IllegalStateException
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public AsyncContext startAsync(ServletRequest servletRequestServletResponse servletResponse)
            throws IllegalStateException
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public boolean isAsyncStarted()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public boolean isAsyncSupported()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    public AsyncContext getAsyncContext()
    {
        throw new UnsupportedOperationException();
    }
    @Override
    {
        throw new UnsupportedOperationException();
    }
New to GrepCode? Check out our FAQ X