All Downloads are FREE. Search and download functionalities are using the official Maven repository.

no.mnemonic.services.common.api.Resource Maven / Gradle / Ivy

There is a newer version: 0.6.15
Show newest version
package no.mnemonic.services.common.api;

import java.io.Closeable;
import java.io.IOException;

/**
 * Represents a closeable resource. In addition to being Closeable,
 * it can be cancelled!
 */
public interface Resource extends Closeable {

    /**
     * Cancel underlying resource. Cancel may often be the same as close, but in some cases,
     * cancel is more abrupt, forcing resources to close abruptly.
     *
     * @throws IOException if exception occurs when cancelling resources
     */
    default void cancel() throws IOException {
        close();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy