001/* 002 * The contents of this file are subject to the license and copyright detailed 003 * in the LICENSE and NOTICE files at the root of the source tree. 004 */ 005package org.duraspace.bagit; 006 007import java.io.IOException; 008import java.nio.file.Path; 009 010/** 011 * Serialize a BagIt bag into a single format. 012 * 013 * @author mikejritter 014 * @since 2020-02-24 015 */ 016@FunctionalInterface 017public interface BagSerializer { 018 019 /** 020 * Serialize a BagIt bag depending on the format defined by the implementing class. This only puts the files into 021 * an archive, with the name of the {@code root} directory serving as the name of the final file. 022 * 023 * @param root the {@link Path} which is the top level directory of the BagIt bag 024 * @return the {@link Path} to the serialized BagIt bag 025 * @throws IOException if there is an error writing to the archive 026 */ 027 Path serialize(Path root) throws IOException; 028 029}