| // Licensed to the Apache Software Foundation (ASF) under one | |
| // or more contributor license agreements. See the NOTICE file | |
| // distributed with this work for additional information | |
| // regarding copyright ownership. The ASF licenses this file | |
| // to you under the Apache License, Version 2.0 (the | |
| // "License"); you may not use this file except in compliance | |
| // with the License. You may obtain a copy of the License at | |
| // | |
| // http://www.apache.org/licenses/LICENSE-2.0 | |
| // | |
| // Unless required by applicable law or agreed to in writing, | |
| // software distributed under the License is distributed on an | |
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
| // KIND, either express or implied. See the License for the | |
| // specific language governing permissions and limitations | |
| // under the License. | |
| // DO NOT EDIT IT MANUALLY. This file is generated by opendal/dev/src/generate/java.rs. | |
| use crate::Result; | |
| use crate::convert; | |
| use jni::Env; | |
| use jni::jni_sig; | |
| use jni::jni_str; | |
| use jni::objects::JObject; | |
| use jni::objects::JValue; | |
| use opendal::Capability; | |
| pub(crate) fn make_capability<'a>(env: &mut Env<'a>, cap: Capability) -> Result<JObject<'a>> { | |
| let capability = env.new_object( | |
| jni_str!("org/apache/opendal/Capability"), | |
| jni_sig!( | |
| "(ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZJJJZZZZZZZZJZZZZZZZZZZZJJZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ)V" | |
| ), | |
| &[ | |
| JValue::Bool(cap.stat), | |
| JValue::Bool(cap.stat_with_if_match), | |
| JValue::Bool(cap.stat_with_if_none_match), | |
| JValue::Bool(cap.stat_with_if_version_match), | |
| JValue::Bool(cap.stat_with_if_version_not_match), | |
| JValue::Bool(cap.stat_with_if_modified_since), | |
| JValue::Bool(cap.stat_with_if_unmodified_since), | |
| JValue::Bool(cap.stat_with_override_cache_control), | |
| JValue::Bool(cap.stat_with_override_content_disposition), | |
| JValue::Bool(cap.stat_with_override_content_type), | |
| JValue::Bool(cap.stat_with_version), | |
| JValue::Bool(cap.read), | |
| JValue::Bool(cap.read_with_if_match), | |
| JValue::Bool(cap.read_with_if_none_match), | |
| JValue::Bool(cap.read_with_if_version_match), | |
| JValue::Bool(cap.read_with_if_version_not_match), | |
| JValue::Bool(cap.read_with_if_modified_since), | |
| JValue::Bool(cap.read_with_if_unmodified_since), | |
| JValue::Bool(cap.read_with_override_cache_control), | |
| JValue::Bool(cap.read_with_override_content_disposition), | |
| JValue::Bool(cap.read_with_override_content_type), | |
| JValue::Bool(cap.read_with_version), | |
| JValue::Bool(cap.read_with_suffix), | |
| JValue::Bool(cap.write), | |
| JValue::Bool(cap.write_can_multi), | |
| JValue::Bool(cap.write_can_empty), | |
| JValue::Bool(cap.write_can_append), | |
| JValue::Bool(cap.write_can_copy_from), | |
| JValue::Bool(cap.write_with_content_type), | |
| JValue::Bool(cap.write_with_content_disposition), | |
| JValue::Bool(cap.write_with_content_encoding), | |
| JValue::Bool(cap.write_with_content_language), | |
| JValue::Bool(cap.write_with_cache_control), | |
| JValue::Bool(cap.write_with_if_match), | |
| JValue::Bool(cap.write_with_if_none_match), | |
| JValue::Bool(cap.write_with_if_version_match), | |
| JValue::Bool(cap.write_with_if_version_not_match), | |
| JValue::Bool(cap.write_with_if_not_exists), | |
| JValue::Bool(cap.write_with_user_metadata), | |
| JValue::Bool(cap.write_with_expires), | |
| JValue::Long(convert::usize_to_jlong(cap.write_multi_max_size)), | |
| JValue::Long(convert::usize_to_jlong(cap.write_multi_min_size)), | |
| JValue::Long(convert::usize_to_jlong(cap.write_total_max_size)), | |
| JValue::Bool(cap.create_dir), | |
| JValue::Bool(cap.delete), | |
| JValue::Bool(cap.delete_with_version), | |
| JValue::Bool(cap.delete_with_recursive), | |
| JValue::Bool(cap.delete_with_if_match), | |
| JValue::Bool(cap.delete_with_if_none_match), | |
| JValue::Bool(cap.delete_with_if_version_match), | |
| JValue::Bool(cap.delete_with_if_version_not_match), | |
| JValue::Long(convert::usize_to_jlong(cap.delete_max_size)), | |
| JValue::Bool(cap.copy), | |
| JValue::Bool(cap.copy_with_if_not_exists), | |
| JValue::Bool(cap.copy_with_if_match), | |
| JValue::Bool(cap.copy_with_if_none_match), | |
| JValue::Bool(cap.copy_with_if_version_match), | |
| JValue::Bool(cap.copy_with_if_version_not_match), | |
| JValue::Bool(cap.copy_with_source_version), | |
| JValue::Bool(cap.copy_with_user_metadata), | |
| JValue::Bool(cap.copy_with_content_type), | |
| JValue::Bool(cap.copy_with_content_language), | |
| JValue::Bool(cap.copy_can_multi), | |
| JValue::Long(convert::usize_to_jlong(cap.copy_multi_max_size)), | |
| JValue::Long(convert::usize_to_jlong(cap.copy_multi_min_size)), | |
| JValue::Bool(cap.compose), | |
| JValue::Bool(cap.compose_with_content_type), | |
| JValue::Bool(cap.compose_with_content_disposition), | |
| JValue::Bool(cap.compose_with_content_encoding), | |
| JValue::Bool(cap.compose_with_cache_control), | |
| JValue::Bool(cap.compose_with_user_metadata), | |
| JValue::Bool(cap.compose_with_if_match), | |
| JValue::Bool(cap.compose_with_if_none_match), | |
| JValue::Bool(cap.compose_with_if_version_match), | |
| JValue::Bool(cap.compose_with_if_version_not_match), | |
| JValue::Bool(cap.compose_with_if_not_exists), | |
| JValue::Bool(cap.compose_with_source_version), | |
| JValue::Bool(cap.compose_with_source_if_match), | |
| JValue::Bool(cap.restore), | |
| JValue::Bool(cap.restore_with_version), | |
| JValue::Bool(cap.restore_with_if_not_exists), | |
| JValue::Bool(cap.rename), | |
| JValue::Bool(cap.rename_with_if_not_exists), | |
| JValue::Bool(cap.list), | |
| JValue::Bool(cap.list_with_limit), | |
| JValue::Bool(cap.list_with_start_after), | |
| JValue::Bool(cap.list_with_recursive), | |
| JValue::Bool(cap.list_with_versions), | |
| JValue::Bool(cap.list_with_deleted), | |
| JValue::Bool(cap.list_with_glob), | |
| JValue::Bool(cap.presign), | |
| JValue::Bool(cap.presign_read), | |
| JValue::Bool(cap.presign_stat), | |
| JValue::Bool(cap.presign_write), | |
| JValue::Bool(cap.presign_delete), | |
| JValue::Bool(cap.shared), | |
| ], | |
| )?; | |
| Ok(capability) | |
| } |