如何检查postman中存在的文件

p1iqtdky  于 2021-06-02  发布在  Hadoop
关注(0)|答案(0)|浏览(282)

我使用的是带有java的postman客户机。我想使用postman测试hadoop中是否存在该文件。
这是我的程序:

String arguments = "hdfs://nameservice1/user/ec2-user/" + bedroom + "-" + bathroom + "-" + area + "-" + city + "/part00000";
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
    .url("http://ec2-52-34-14-38.us-west-2.compute.amazonaws.com:14000/webhdfs/v1/user/ec2-user/" + bedroom + "-" + bathroom + "-" + area + "-" + city + "/part-00000?user.name=ec2-user&op=OPEN")
    .build();
if (request.equals(arguments)) {
    com.squareup.okhttp.Response responses = null;
    responses = client.newCall(request).execute();
    System.out.println(responses);
    String output = "Prediction Value is " + responses.body().string();
    return Response.status(200).entity(output).build();
} else {
    oozie objOz = new oozie(bedroom, bathroom, area, city);
    String response = objOz.callOozie();
    System.out.print("The Predicted Value is :" + response);
    com.squareup.okhttp.Response responses = null;
    responses = client.newCall(request).execute();
    System.out.println(responses);
    String output = "Prediction Value is " + responses.body().string();
    return Response.status(200).entity(output).build();
}

if-else部分不起作用。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题