Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,15 @@ public String getRemoteAddr() {
@Override
public String getQueryString() {
try {
return (new URI(req.getUri()).getQuery());
return (new URI(req.uri()).getQuery());
} catch (URISyntaxException e) {
return null;
}
}

@Override
public String getRequestURI() {
String uri = req.getUri();
String uri = req.uri();
// Netty's getUri includes the query string, while Servlet's does not
return (uri.substring(0, uri.indexOf("?") >= 0 ? uri.indexOf("?") :
uri.length()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ public WebHdfsHandler(Configuration conf, Configuration confForCreate)
@Override
public void channelRead0(final ChannelHandlerContext ctx,
final HttpRequest req) throws Exception {
Preconditions.checkArgument(req.getUri().startsWith(WEBHDFS_PREFIX));
QueryStringDecoder queryString = new QueryStringDecoder(req.getUri());
Preconditions.checkArgument(req.uri().startsWith(WEBHDFS_PREFIX));
QueryStringDecoder queryString = new QueryStringDecoder(req.uri());
params = new ParameterParser(queryString, conf);
DataNodeUGIProvider ugiProvider = new DataNodeUGIProvider(params);
ugi = ugiProvider.ugi();
Expand All @@ -144,7 +144,7 @@ public Void run() throws Exception {
LOG.warn("Error retrieving hostname: ", e);
host = "unknown";
}
REQLOG.info(host + " " + req.getMethod() + " " + req.getUri() + " " +
REQLOG.info(host + " " + req.method() + " " + req.uri() + " " +
getResponseCode());
}
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class TestHostRestrictingAuthorizationFilterHandler {
* Test running in with no ACL rules (restrict all)
*/
@Test
public void testRejectAll() throws Exception {
public void testRejectAll() {
EmbeddedChannel channel = new CustomEmbeddedChannel("127.0.0.1", 1006,
new HostRestrictingAuthorizationFilterHandler());
FullHttpRequest httpRequest =
Expand All @@ -61,7 +61,7 @@ public void testRejectAll() throws Exception {
DefaultHttpResponse channelResponse =
(DefaultHttpResponse) channel.outboundMessages().poll();
assertNotNull("Expected response to exist.", channelResponse);
assertEquals(HttpResponseStatus.FORBIDDEN, channelResponse.getStatus());
assertEquals(HttpResponseStatus.FORBIDDEN, channelResponse.status());
assertFalse(channel.isOpen());
}

Expand All @@ -70,7 +70,7 @@ public void testRejectAll() throws Exception {
* reused
*/
@Test
public void testMultipleAcceptedGETsOneChannel() throws Exception {
public void testMultipleAcceptedGETsOneChannel() {
Configuration conf = new Configuration();
conf.set(CONFNAME, "*,*,/allowed");
HostRestrictingAuthorizationFilter filter =
Expand Down Expand Up @@ -102,7 +102,7 @@ public void testMultipleAcceptedGETsOneChannel() throws Exception {
* single filter instance
*/
@Test
public void testMultipleChannels() throws Exception {
public void testMultipleChannels() {
Configuration conf = new Configuration();
conf.set(CONFNAME, "*,*,/allowed");
HostRestrictingAuthorizationFilter filter =
Expand Down Expand Up @@ -140,7 +140,7 @@ public void testMultipleChannels() throws Exception {
* Test accepting a GET request for the file checksum
*/
@Test
public void testAcceptGETFILECHECKSUM() throws Exception {
public void testAcceptGETFILECHECKSUM() {
EmbeddedChannel channel = new CustomEmbeddedChannel("127.0.0.1", 1006,
new HostRestrictingAuthorizationFilterHandler());
FullHttpRequest httpRequest =
Expand All @@ -158,7 +158,7 @@ public void testAcceptGETFILECHECKSUM() throws Exception {
*/
protected static class CustomEmbeddedChannel extends EmbeddedChannel {

private InetSocketAddress socketAddress;
private final InetSocketAddress socketAddress;

/*
* A normal @{EmbeddedChannel} constructor which takes the remote client
Expand Down