diff --git a/libs/jwst-binding/jwst-jni/android/src/main/java/com/toeverything/jwst/lib/JwstStorage.java b/libs/jwst-binding/jwst-jni/android/src/main/java/com/toeverything/jwst/lib/JwstStorage.java index e849c03d..0e776e38 100644 --- a/libs/jwst-binding/jwst-jni/android/src/main/java/com/toeverything/jwst/lib/JwstStorage.java +++ b/libs/jwst-binding/jwst-jni/android/src/main/java/com/toeverything/jwst/lib/JwstStorage.java @@ -58,12 +58,12 @@ public final boolean is_error() { } private static native @NonNull String do_get_sync_state(long self); - public final boolean init(@NonNull String workspace_id, @NonNull byte [] data) { - boolean ret = do_init(mNativeObj, workspace_id, data); + public final boolean import(@NonNull String workspace_id, @NonNull byte [] data) { + boolean ret = do_import(mNativeObj, workspace_id, data); return ret; } - private static native boolean do_init(long self, @NonNull String workspace_id, byte [] data); + private static native boolean do_import(long self, @NonNull String workspace_id, byte [] data); public final byte [] export(@NonNull String workspace_id) { byte [] ret = do_export(mNativeObj, workspace_id); diff --git a/libs/jwst-binding/jwst-jni/build.rs b/libs/jwst-binding/jwst-jni/build.rs index 2c0d81dd..a8507f8e 100644 --- a/libs/jwst-binding/jwst-jni/build.rs +++ b/libs/jwst-binding/jwst-jni/build.rs @@ -56,7 +56,7 @@ foreign_typemap!( fn JwstStorage::is_finished(&self) -> bool; fn JwstStorage::is_error(&self) -> bool; fn JwstStorage::get_sync_state(&self) -> String; - fn JwstStorage::init(&mut self, workspace_id: String, data: &[u8]) -> bool; alias init; + fn JwstStorage::import(&mut self, workspace_id: String, data: &[u8]) -> bool; alias import; fn JwstStorage::export(&mut self, workspace_id: String) -> Vec; alias export; fn JwstStorage::connect(&mut self, workspace_id: String, remote: String) -> Option; alias connect; fn JwstStorage::get_last_synced(&self) ->Vec; @@ -132,7 +132,7 @@ foreign_class!( != fs::read_to_string(in_temp.with_extension("")).unwrap() { fs::copy(in_temp.with_extension("out"), in_temp.with_extension("")).unwrap(); - fs::copy(in_temp.with_extension("out"), in_src).unwrap(); + fs::copy(in_temp.with_extension("in"), in_src).unwrap(); } } } diff --git a/libs/jwst-binding/jwst-jni/src/java_glue.rs.in b/libs/jwst-binding/jwst-jni/src/java_glue.rs.in index ce1ecea0..b10ccdf6 100644 --- a/libs/jwst-binding/jwst-jni/src/java_glue.rs.in +++ b/libs/jwst-binding/jwst-jni/src/java_glue.rs.in @@ -39,7 +39,7 @@ foreign_class!( fn JwstStorage::is_finished(&self) -> bool; fn JwstStorage::is_error(&self) -> bool; fn JwstStorage::get_sync_state(&self) -> String; - fn JwstStorage::init(&mut self, workspace_id: String, data: &[u8]) -> bool; alias init; + fn JwstStorage::import(&mut self, workspace_id: String, data: &[u8]) -> bool; alias import; fn JwstStorage::export(&mut self, workspace_id: String) -> Vec; alias export; fn JwstStorage::connect(&mut self, workspace_id: String, remote: String) -> Option; alias connect; fn JwstStorage::get_last_synced(&self) ->Vec; diff --git a/libs/jwst-binding/jwst-jni/src/storage.rs b/libs/jwst-binding/jwst-jni/src/storage.rs index c183dc6c..e364f82c 100644 --- a/libs/jwst-binding/jwst-jni/src/storage.rs +++ b/libs/jwst-binding/jwst-jni/src/storage.rs @@ -91,8 +91,8 @@ impl JwstStorage { } } - pub fn init(&mut self, workspace_id: String, data: &[u8]) -> bool { - match self.init_workspace(workspace_id, data) { + pub fn import(&mut self, workspace_id: String, data: &[u8]) -> bool { + match self.import_workspace(workspace_id, data) { Ok(_) => true, Err(e) => { let error = format!("Failed to init workspace: {:?}", e); @@ -103,7 +103,7 @@ impl JwstStorage { } } - fn init_workspace(&self, workspace_id: String, data: &[u8]) -> JwstStorageResult { + fn import_workspace(&self, workspace_id: String, data: &[u8]) -> JwstStorageResult { let rt = Arc::new( Builder::new_multi_thread() .worker_threads(1) diff --git a/libs/jwst-binding/jwst-swift/src/lib.rs b/libs/jwst-binding/jwst-swift/src/lib.rs index 5872026a..74634e57 100644 --- a/libs/jwst-binding/jwst-swift/src/lib.rs +++ b/libs/jwst-binding/jwst-swift/src/lib.rs @@ -134,7 +134,7 @@ mod ffi { fn get_sync_state(self: &Storage) -> String; - fn init(self: &mut Storage, workspace_id: String, data: Vec) -> bool; + fn import(self: &mut Storage, workspace_id: String, data: Vec) -> bool; fn export(self: &mut Storage, workspace_id: String) -> Option>; diff --git a/libs/jwst-binding/jwst-swift/src/storage.rs b/libs/jwst-binding/jwst-swift/src/storage.rs index 450fc1ae..704704d4 100644 --- a/libs/jwst-binding/jwst-swift/src/storage.rs +++ b/libs/jwst-binding/jwst-swift/src/storage.rs @@ -88,8 +88,8 @@ impl Storage { } } - pub fn init(&mut self, workspace_id: String, data: Vec) -> bool { - match self.init_workspace(workspace_id, data) { + pub fn import(&mut self, workspace_id: String, data: Vec) -> bool { + match self.import_workspace(workspace_id, data) { Ok(_) => true, Err(e) => { let error = format!("Failed to init workspace: {:?}", e); @@ -100,7 +100,7 @@ impl Storage { } } - fn init_workspace(&self, workspace_id: String, data: Vec) -> JwstStorageResult { + fn import_workspace(&self, workspace_id: String, data: Vec) -> JwstStorageResult { let rt = Arc::new( Builder::new_multi_thread() .worker_threads(1)