1 package uk.ac.cam.spectra.spectrasub;
2
3 import java.io.File;
4 import java.io.IOException;
5
6 /**
7 * Interface for components that encode metadata, write manifests and bundle
8 * resources into archives.
9 *
10 * @author ojd20
11 */
12 public interface Packager {
13
14 /**
15 * Transcode the metadata of package into the final manifest format, and
16 * archive (by an implementation specific method) the entire package
17 * contents into the destination file.
18 *
19 * @param pkg
20 * @param destinationFile
21 * @throws IOException
22 */
23 void transcodeAndSerialize(DataPackage pkg, File destinationFile)
24 throws IOException;
25
26 /**
27 * Get the path of the manifest file inside the package.
28 *
29 * @param p the data package
30 * @return
31 */
32 String getManifestName(DataPackage p);
33
34 /**
35 *
36 * @param packageId
37 * @param filename
38 * @return
39 * @throws NotFoundException
40 */
41 FileAndType getFileAndType(String packageId, String filename)
42 throws NotFoundException;
43 }