Skip to content

Package: ArchiveFile

ArchiveFile

nameinstructionbranchcomplexitylinemethod
ArchiveFile(String, int, ArchiveData, String)
M: 0 C: 11
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 4
100%
M: 0 C: 1
100%
accept(ArchiveComponentVisitor)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
getArchiveData()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getFlags()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: package archive;
2:
3: import java.io.FileNotFoundException;
4: import java.io.IOException;
5:
6: /**
7: * Represents a file, which should be put in the an archive.
8: */
9: public class ArchiveFile extends AccessibleAbstractArchiveComponent {
10:
11:         /**
12:          * Default value for flags property.
13:          */
14:         public static final String DEFAULT_FLAG = "sh";
15:
16:         /**
17:          * the data, that should be put in the archive as content of the file.
18:          */
19:         private final ArchiveData data;
20:         /**
21:          * the flags of the file. Default value is sh.
22:          */
23:         private final String flags;
24:
25:         /**
26:          * Creates a ArchiveFile.
27:          *
28:          * @param name
29:          * the name of the archive file
30:          * @param mode
31:          * the access mode
32:          * @param data
33:          * the content of the archive file.
34:          * @param flags
35:          * the flags
36:          */
37:         public ArchiveFile(final String name, final int mode, final ArchiveData data,
38:                         final String flags) {
39:                 super(name, mode);
40:                 this.data = data;
41:                 this.flags = flags;
42:         }
43:
44:         @Override
45:         public void accept(final ArchiveComponentVisitor visitor)
46:                         throws FileNotFoundException, IOException {
47:                 visitor.handleArchiveFile(this);
48:
49:         }
50:
51:         /**
52:          * Getter.
53:          *
54:          * @return the archive data
55:          */
56:         public ArchiveData getArchiveData() {
57:                 return data;
58:         }
59:
60:         /**
61:          * Getter.
62:          *
63:          * @return the flags
64:          */
65:         public String getFlags() {
66:                 return flags;
67:         }
68: }