~xdavidwu/saf-cephfs

009ee2902324246f306392fd4c742c9ef533e07c — Pinghao Wu a month ago 2c7f998
CephFSExecutor: preserve FileNotFoundException
M src/main/java/org/safcephfs/CephFSDocumentsProvider.java => src/main/java/org/safcephfs/CephFSDocumentsProvider.java +2 -1
@@ 377,7 377,8 @@ public class CephFSDocumentsProvider extends DocumentsProvider {
		return result;
	}

	private long getXattrULL(String path, String name) {
	private long getXattrULL(String path, String name)
			throws FileNotFoundException {
		var buf = new byte[32];
		var l = executor.executeWithUnchecked(cm -> {
			return cm.getxattr(path, name, buf);

M src/main/java/org/safcephfs/CephFSExecutor.java => src/main/java/org/safcephfs/CephFSExecutor.java +9 -3
@@ 7,6 7,7 @@ import android.provider.DocumentsContract;
import android.system.ErrnoException;
import android.system.OsConstants;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.util.Map;


@@ 168,9 169,12 @@ public class CephFSExecutor {
		}
	}

	protected <T> T executeWithCursorExtra(Operation<T> op, Cursor c) {
	protected <T> T executeWithCursorExtra(Operation<T> op, Cursor c)
			throws FileNotFoundException {
		try {
			return execute(op);
		} catch (FileNotFoundException e) {
			throw e;
		} catch (IOException e) {
			var extra = new Bundle();
			var msg = e.getMessage();


@@ 181,10 185,12 @@ public class CephFSExecutor {
		}
	}

	protected <T> T executeWithUnchecked(Operation<T> op) {
	protected <T> T executeWithUnchecked(Operation<T> op)
			throws FileNotFoundException {
		try {
			return execute(op);
		// TODO preserve IOE subclasses
		} catch (FileNotFoundException e) {
			throw e;
		} catch (IOException e) {
			throw new UncheckedIOException(e);
		}