Bundle.java

package it.fe.cassano.cryptoapi;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Path;

public abstract class Bundle
{
    protected final Path          filename;
    protected IndexingInformation indexingInformation;

    protected Bundle(final Path filename)
    {
        this.filename = filename;
    }

    public InputStream getData() throws IOException
    {
        return new FileInputStream(filename.toFile());
    }

    public IndexingInformation getIndexingInformation()
    {
        return this.indexingInformation;
    }

    public String getFilename()
    {
        return this.filename.getFileName().toString();
    }

}