|
@@ -28,6 +28,7 @@ import java.util.EnumSet;
|
|
|
|
|
|
import javax.servlet.ServletContext;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.ws.rs.Consumes;
|
|
|
import javax.ws.rs.DELETE;
|
|
|
import javax.ws.rs.DefaultValue;
|
|
@@ -108,6 +109,7 @@ public class NamenodeWebHdfsMethods {
|
|
|
|
|
|
private @Context ServletContext context;
|
|
|
private @Context HttpServletRequest request;
|
|
|
+ private @Context HttpServletResponse response;
|
|
|
|
|
|
private static DatanodeInfo chooseDatanode(final NameNode namenode,
|
|
|
final String path, final HttpOpParam.Op op, final long openOffset
|
|
@@ -226,6 +228,9 @@ public class NamenodeWebHdfsMethods {
|
|
|
modificationTime, accessTime, renameOptions));
|
|
|
}
|
|
|
|
|
|
+ //clear content type
|
|
|
+ response.setContentType(null);
|
|
|
+
|
|
|
return ugi.doAs(new PrivilegedExceptionAction<Response>() {
|
|
|
@Override
|
|
|
public Response run() throws IOException, URISyntaxException {
|
|
@@ -317,6 +322,9 @@ public class NamenodeWebHdfsMethods {
|
|
|
+ Param.toSortedString(", ", bufferSize));
|
|
|
}
|
|
|
|
|
|
+ //clear content type
|
|
|
+ response.setContentType(null);
|
|
|
+
|
|
|
return ugi.doAs(new PrivilegedExceptionAction<Response>() {
|
|
|
@Override
|
|
|
public Response run() throws IOException, URISyntaxException {
|
|
@@ -394,6 +402,8 @@ public class NamenodeWebHdfsMethods {
|
|
|
+ Param.toSortedString(", ", offset, length, renewer, bufferSize));
|
|
|
}
|
|
|
|
|
|
+ //clear content type
|
|
|
+ response.setContentType(null);
|
|
|
|
|
|
return ugi.doAs(new PrivilegedExceptionAction<Response>() {
|
|
|
@Override
|
|
@@ -522,6 +532,9 @@ public class NamenodeWebHdfsMethods {
|
|
|
+ Param.toSortedString(", ", recursive));
|
|
|
}
|
|
|
|
|
|
+ //clear content type
|
|
|
+ response.setContentType(null);
|
|
|
+
|
|
|
return ugi.doAs(new PrivilegedExceptionAction<Response>() {
|
|
|
@Override
|
|
|
public Response run() throws IOException {
|