use of com.amazonaws.services.s3.Headers in project hadoop by apache.
the class S3AFileSystem method newObjectMetadata.
/**
* Create a new object metadata instance.
* Any standard metadata headers are added here, for example:
* encryption.
* @return a new metadata instance
*/
public ObjectMetadata newObjectMetadata() {
final ObjectMetadata om = new ObjectMetadata();
setOptionalObjectMetadata(om);
return om;
}
use of com.amazonaws.services.s3.Headers in project EhViewer by seven332.
the class EhEngine method getProfile.
public static ProfileParser.Result getProfile(@Nullable EhClient.Task task, OkHttpClient okHttpClient) throws Exception {
String url = EhUrl.URL_FORUMS;
Log.d(TAG, url);
Request request = new EhRequestBuilder(url, null != task ? task.getEhConfig() : Settings.getEhConfig()).build();
Call call = okHttpClient.newCall(request);
// Put call
if (null != task) {
task.setCall(call);
}
String body = null;
Headers headers = null;
int code = -1;
try {
Response response = call.execute();
code = response.code();
headers = response.headers();
body = response.body().string();
return getProfileInternal(task, okHttpClient, ForumsParser.parse(body));
} catch (Exception e) {
throwException(call, code, headers, body, e);
throw e;
}
}
use of com.amazonaws.services.s3.Headers in project EhViewer by seven332.
the class EhEngine method getGalleryToken.
public static String getGalleryToken(@Nullable EhClient.Task task, OkHttpClient okHttpClient, long gid, String gtoken, int page) throws Exception {
JSONObject json = new JSONObject().put("method", "gtoken").put("pagelist", new JSONArray().put(new JSONArray().put(gid).put(gtoken).put(page + 1)));
final RequestBody requestBody = RequestBody.create(MEDIA_TYPE_JSON, json.toString());
String url = EhUrl.getApiUrl();
Log.d(TAG, url);
Request request = new EhRequestBuilder(url, null != task ? task.getEhConfig() : Settings.getEhConfig()).post(requestBody).build();
Call call = okHttpClient.newCall(request);
// Put call
if (null != task) {
task.setCall(call);
}
String body = null;
Headers headers = null;
int code = -1;
try {
Response response = call.execute();
code = response.code();
headers = response.headers();
body = response.body().string();
return GalleryTokenApiParser.parse(body);
} catch (Exception e) {
throwException(call, code, headers, body, e);
throw e;
}
}
use of com.amazonaws.services.s3.Headers in project EhViewer by seven332.
the class EhEngine method getWhatsHot.
public static List<GalleryInfo> getWhatsHot(@Nullable EhClient.Task task, OkHttpClient okHttpClient) throws Exception {
String url = EhUrl.HOST_E;
Log.d(TAG, url);
Request request = new EhRequestBuilder(url, null != task ? task.getEhConfig() : Settings.getEhConfig()).build();
Call call = okHttpClient.newCall(request);
// Put call
if (null != task) {
task.setCall(call);
}
String body = null;
Headers headers = null;
List<GalleryInfo> list;
int code = -1;
try {
Response response = call.execute();
code = response.code();
headers = response.headers();
body = response.body().string();
list = WhatsHotParser.parse(body);
} catch (Exception e) {
throwException(call, code, headers, body, e);
throw e;
}
if (list.size() > 0) {
// Fill by api
fillGalleryListByApi(task, okHttpClient, list);
}
for (GalleryInfo info : list) {
info.thumb = EhUrl.getFixedPreviewThumbUrl(info.thumb);
}
return list;
}
use of com.amazonaws.services.s3.Headers in project EhViewer by seven332.
the class EhEngine method getGalleryPage.
public static GalleryPageParser.Result getGalleryPage(@Nullable EhClient.Task task, OkHttpClient okHttpClient, String url) throws Exception {
Log.d(TAG, url);
Request request = new EhRequestBuilder(url, null != task ? task.getEhConfig() : Settings.getEhConfig()).build();
Call call = okHttpClient.newCall(request);
// Put call
if (null != task) {
task.setCall(call);
}
String body = null;
Headers headers = null;
int code = -1;
try {
Response response = call.execute();
code = response.code();
headers = response.headers();
body = response.body().string();
return GalleryPageParser.parse(body);
} catch (Exception e) {
throwException(call, code, headers, body, e);
throw e;
}
}
Aggregations