/** * Delete a {@link Dataset} identified by the given dataset URI. * <p> * When you call this method using a dataset URI, both data and metadata are * deleted. After you call this method, the dataset no longer exists, unless * an exception is thrown. * <p> * When you call this method using a view URI, data in that view is deleted. * The dataset's metadata is not changed. This can throw an * {@code UnsupportedOperationException} if the delete requires additional * work. For example, if some, but not all, of the data in an underlying data * file must be removed, then the implementation is allowed to reject the * deletion rather than copy the remaining records to a new file. * An implementation must document under what conditions it accepts deletes, * and under what conditions it rejects them. * <p> * URIs must begin with {@code dataset:}. The remainder of * the URI is implementation specific, depending on the dataset scheme. * * @param uri a {@code Dataset} URI * @return {@code true} if any data or metadata is removed, {@code false} * otherwise * @throws NullPointerException if {@code uri} is null * @throws IllegalArgumentException if {@code uri} is not a dataset URI */ public static boolean delete(URI uri) { return deleteWithTrash(uri, false); }
/** * Move a {@link Dataset} identified by the given dataset URI to trash. * <p> * When you call this method using a dataset URI, both data and metadata are * moved to trash. After you call this method, the dataset no longer exists, unless * an exception is thrown. * <p> * When you call this method using a view URI, data in that view is moved to trash. * The dataset's metadata is not changed. This can throw an * {@code UnsupportedOperationException} if the move to trash requires additional * work. For example, if some, but not all, of the data in an underlying data * file must be removed, then the implementation is allowed to reject the * move to trash rather than copy the remaining records to a new file. * An implementation must document under what conditions it accepts moves to trash, * and under what conditions it rejects them. * <p> * URIs must begin with {@code dataset:}. The remainder of * the URI is implementation specific, depending on the dataset scheme. * * @param uri a {@code Dataset} URI * @return {@code true} if any data or metadata is removed, {@code false} * otherwise * @throws NullPointerException if {@code uri} is null * @throws IllegalArgumentException if {@code uri} is not a dataset URI */ public static boolean moveToTrash(URI uri) { return deleteWithTrash(uri, true); }