public void deleteObject(final String relativePath, Map<String, Object> object,
boolean sync,
boolean isEventually,
GenericObjectCallback callback, String objectId, String _internalId) {
try {
if (isEventually) {
File archivedFile = archiveRequest("delete", relativePath, null, objectId, _internalId);
handleArchivedRequest(archivedFile, sync, callback);
} else {
String url = buildUrl(relativePath);
String body = AVUtils.jsonStringFromMapWithNull(object);
if (InternalConfigurationController.globalInstance().getInternalLogger().isDebugEnabled()) {
dumpHttpDeleteRequest(null, url, body);
}
AsyncHttpResponseHandler handler = createPostHandler(callback);
AVHttpClient client = clientInstance();
Request.Builder builder = new Request.Builder();
updateHeaders(builder, null, callback != null && callback.isRequestStatisticNeed());
builder.url(url)
.delete(RequestBody.create(AVHttpClient.JSON, body));
client.execute(builder.build(), sync, handler);
}
} catch (Exception exception) {
processException(exception, callback);
}
}