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

gov.loc.repository.bagit.BagFile Maven / Gradle / Ivy

Go to download

The BAGIT LIBRARY is a software library intended to support the creation, manipulation, and validation of bags. Its current version is 0.97. It is version aware with the earliest supported version being 0.93.

There is a newer version: 5.2.0
Show newest version
package gov.loc.repository.bagit;

import java.io.InputStream;

/**
 * Represents a file in a bag.  The file may be either a tag file,
 * such as a {@link Manifest} or a {@link BagInfoTxt}, or it may
 * be an ordinary payload file.
 */
public interface BagFile {
	
	/**
	 * Opens the file for reading.
	 * @return A new stream for reading the contents of the file.
	 * @throws RuntimeException Thrown if the file cannot be opened.
	 */
	InputStream newInputStream();
	
	/**
	 * Gets the path of the file, relative to the bag directory.
	 * @return The path of the file.  Will never be null.
	 */
	String getFilepath();
	
	/**
	 * Determines whether the file exists on disk or not.
	 * @return Return true if the file file exists;
	 * false otherwise.
	 */
	boolean exists();
	
	/**
	 * Gets the size of the file on disk.
	 * @return The size of the file, or 0 if the file does not exist.
	 */
	long getSize();
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy