Skip to content

Instantly share code, notes, and snippets.

@imeredith
Created February 28, 2013 03:24
Show Gist options
  • Save imeredith/5053930 to your computer and use it in GitHub Desktop.
Save imeredith/5053930 to your computer and use it in GitHub Desktop.
private static class RequestImpl implements Request {
private final String uri;
public RequestImpl(String uri) {
this.uri = uri;
}
@Override
public String getRequestURI() {
return uri;
}
@Override
public String getHeader(String name) {
return null;
}
@Override
public String getRemoteUser() {
return null;
}
@Override
public Enumeration getParameterNames() {
return Collections.enumeration(Collections.EMPTY_LIST);
}
@Override
public String[] getParameterValues(String name) {
return new String[0];
}
@Override
public Object getAttribute(String name) {
return null;
}
}
class RequestImpl(url: String) extends Request {
override def getRequestURI = url
override def getHeader(name: String) = null
override def getRemoteUser = null
override def getParameterNames = Collections.enumeration(Collections.EMPTY_LIST);
override def getParameterValues(name: String) = Array[String]()
override def getAttribute(name: String) = null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment