KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > SOFA > SOFAnode > TR > Impl > BundleEntry


1 /**
2  * BundleEntry.java is a part of the SOFA project.
3  * This file was created by pepan on 21.3.2003.
4  */

5 package SOFA.SOFAnode.TR.Impl;
6
7 import java.io.File JavaDoc;
8 import java.util.jar.JarEntry JavaDoc;
9
10 /**
11  * One bundle entry (a component) of bundle input/output streams. It's used when
12  * putting a component to the stream or getting a component from it. Its use is
13  * similar to {@link JarEntry}.
14  * @author Petr Panuska
15  */

16 class BundleEntry extends JarEntry JavaDoc {
17
18   /**
19    * All filles creating one component.
20    */

21   private ComponentFiles files;
22
23   /**
24    * Creates an entry with a given name. The name should be unique.
25    * @param name the name of this entry in a JAR file.
26    */

27   BundleEntry (String JavaDoc name) {
28     super(name);
29     files = new ComponentFiles();
30   }
31
32   /**
33    * Creates an entry with a given name and assigns the component files.
34    * The name should be unique.
35    * @param name the name of this entry in a JAR file.
36    * @param files a set of files creating the component being described by this
37    * entry.
38    */

39   BundleEntry (String JavaDoc name, ComponentFiles files) {
40     super(name);
41     this.files = files;
42   }
43
44   /**
45    * Adds a file under a given unique name. The file should not be a directory.
46    * @param file the file being added.
47    * @param name the unique name.
48    */

49   void addFile (File JavaDoc file, String JavaDoc name) {
50     files.addFile(file, name);
51   }
52
53   /**
54    * Gets files being a part of this entry.
55    * @return all files creating a component (which this entry describes).
56    */

57   ComponentFiles getFiles () {
58     return files;
59   }
60 }
61
Popular Tags