Skip to content

Commit

Permalink
docs: more improvements
Browse files Browse the repository at this point in the history
Signed-off-by: tison <wander4096@gmail.com>
  • Loading branch information
tisonkun committed May 27, 2023
1 parent 8427cd7 commit 408885d
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bindings/java/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl Error {
&self,
env: &mut JNIEnv<'local>,
) -> jni::errors::Result<JThrowable<'local>> {
let class = env.find_class("org/apache/opendal/exception/OpenDALException")?;
let class = env.find_class("org/apache/opendal/OpenDALException")?;
let code = env.new_string(match self.inner.kind() {
ErrorKind::Unexpected => "Unexpected",
ErrorKind::Unsupported => "Unsupported",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.util.Map;

/**
* A {@code BlockingOperator} represents an underneath OpenDAL operator that
* BlockingOperator represents an underneath OpenDAL operator that
* accesses data synchronously.
*/
public class BlockingOperator extends NativeObject {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
import java.io.UncheckedIOException;
import java.util.Properties;

/**
* Environment resolves environment-specific project metadata.
*/
public enum Environment {
INSTANCE;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import java.util.concurrent.atomic.AtomicReference;

/**
* {@code NativeObject} is the base-class of all OpenDAL classes that have
* NativeObject is the base-class of all OpenDAL classes that have
* a pointer to a native object.
*
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
* under the License.
*/

package org.apache.opendal.exception;
package org.apache.opendal;

/**
* A OpenDALException encapsulates the error of an operation. This exception
* An OpenDALException encapsulates the error of an operation. This exception
* type is used to describe an internal error from the native opendal library.
*/
public class OpenDALException extends RuntimeException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import java.util.concurrent.ConcurrentHashMap;

/**
* An {@code Operator} represents an underneath OpenDAL operator that
* Operator represents an underneath OpenDAL operator that
* accesses data asynchronously.
*/
public class Operator extends NativeObject {
Expand Down
20 changes: 20 additions & 0 deletions bindings/java/src/main/java/org/apache/opendal/package-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* 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.
*/

package org.apache.opendal;
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import java.util.HashMap;
import java.util.Map;
import org.apache.opendal.exception.OpenDALException;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.CompletionException;
import org.apache.opendal.exception.OpenDALException;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand All @@ -49,7 +48,7 @@ public void testCreateAndDelete() {
assertThat(op.read("testCreateAndDelete").join()).isEqualTo("Odin");
op.delete("testCreateAndDelete");
op.stat("testCreateAndDelete")
.handle((r, e) -> {
.handle((r, e) -> {
assertThat(r).isNull();
assertThat(e).isInstanceOf(CompletionException.class).hasCauseInstanceOf(OpenDALException.class);
OpenDALException.Code code = ((OpenDALException) e.getCause()).getCode();
Expand Down

0 comments on commit 408885d

Please sign in to comment.