EMMA Coverage Report (generated Tue Mar 14 21:50:42 EST 2006)
[all classes][org.farng.mp3.id3]

COVERAGE SUMMARY FOR SOURCE FILE [FrameBodyENCR.java]

nameclass, %method, %block, %line, %
FrameBodyENCR.java0%   (0/1)0%   (0/8)0%   (0/71)0%   (0/20)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class FrameBodyENCR0%   (0/1)0%   (0/8)0%   (0/71)0%   (0/20)
FrameBodyENCR (): void 0%   (0/1)0%   (0/3)0%   (0/2)
FrameBodyENCR (FrameBodyENCR): void 0%   (0/1)0%   (0/4)0%   (0/2)
FrameBodyENCR (RandomAccessFile): void 0%   (0/1)0%   (0/6)0%   (0/3)
FrameBodyENCR (String, byte, byte []): void 0%   (0/1)0%   (0/18)0%   (0/5)
getIdentifier (): String 0%   (0/1)0%   (0/10)0%   (0/1)
getOwner (): String 0%   (0/1)0%   (0/5)0%   (0/1)
setOwner (String): void 0%   (0/1)0%   (0/5)0%   (0/2)
setupObjectList (): void 0%   (0/1)0%   (0/20)0%   (0/4)

1package org.farng.mp3.id3;
2 
3import org.farng.mp3.InvalidTagException;
4import org.farng.mp3.object.ObjectByteArraySizeTerminated;
5import org.farng.mp3.object.ObjectNumberFixedLength;
6import org.farng.mp3.object.ObjectStringNullTerminated;
7 
8import java.io.IOException;
9import java.io.RandomAccessFile;
10 
11/**
12 * <h3>4.25.&nbsp;&nbsp; Encryption method registration</h3>
13 * <p/>
14 * <p>&nbsp;&nbsp; To identify with which method a frame has been encrypted the<br>
15 * <p/>
16 * &nbsp;&nbsp; encryption method must be registered in the tag with this frame. The<br> &nbsp;&nbsp; 'Owner identifier'
17 * is a null-terminated string with a URL [URL]<br> &nbsp;&nbsp; containing an email address, or a link to a location
18 * where an email<br> &nbsp;&nbsp; address can be found, that belongs to the organisation responsible<br> &nbsp;&nbsp;
19 * for this specific encryption method. Questions regarding the<br>
20 * <p/>
21 * &nbsp;&nbsp; encryption method should be sent to the indicated email address. The<br> &nbsp;&nbsp; 'Method symbol'
22 * contains a value that is associated with this method<br> &nbsp;&nbsp; throughout the whole tag, in the range $80-F0.
23 * All other values are<br> &nbsp;&nbsp; reserved. The 'Method symbol' may optionally be followed by<br> &nbsp;&nbsp;
24 * encryption specific data. There may be several &quot;ENCR&quot;
25 * <p/>
26 * frames in a tag<br> &nbsp;&nbsp; but only one containing the same symbol and only one containing the<br> &nbsp;&nbsp;
27 * same owner identifier. The method must be used somewhere in the tag.<br> &nbsp;&nbsp; See the description of the
28 * frame encryption flag in the ID3v2<br> &nbsp;&nbsp; structure document [ID3v2-strct] for more information.</p>
29 * <p/>
30 * <p>&nbsp;&nbsp;&nbsp;&nbsp; &lt;Header for 'Encryption method registration', ID: &quot;ENCR&quot;&gt;<br>
31 * &nbsp;&nbsp;&nbsp;&nbsp; Owner identifier&nbsp;&nbsp;&nbsp; &lt;text string&gt; $00<br> &nbsp;&nbsp;&nbsp;&nbsp;
32 * Method symbol&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $xx<br>
33 * <p/>
34 * &nbsp;&nbsp;&nbsp;&nbsp; Encryption data&nbsp;&nbsp;&nbsp;&nbsp; &lt;binary data&gt;<br> </p>
35 *
36 * @author Eric Farng
37 * @version $Revision: 1.4 $
38 */
39public class FrameBodyENCR extends AbstractID3v2FrameBody {
40 
41    /**
42     * Creates a new FrameBodyENCR object.
43     */
44    public FrameBodyENCR() {
45        super();
46    }
47 
48    /**
49     * Creates a new FrameBodyENCR object.
50     */
51    public FrameBodyENCR(final FrameBodyENCR body) {
52        super(body);
53    }
54 
55    /**
56     * Creates a new FrameBodyENCR object.
57     */
58    public FrameBodyENCR(final String owner, final byte methodSymbol, final byte[] data) {
59        setObject("Owner", owner);
60        setObject("Method Symbol", new Byte(methodSymbol));
61        setObject("Encryption Data", data);
62    }
63 
64    /**
65     * Creates a new FrameBodyENCR object.
66     */
67    public FrameBodyENCR(final RandomAccessFile file) throws IOException, InvalidTagException {
68        this.read(file);
69    }
70 
71    public String getIdentifier() {
72        return "ENCR" + ((char) 0) + getOwner();
73    }
74 
75    public void setOwner(final String owner) {
76        setObject("Owner", owner);
77    }
78 
79    public String getOwner() {
80        return (String) getObject("Owner");
81    }
82 
83    protected void setupObjectList() {
84        appendToObjectList(new ObjectStringNullTerminated("Owner"));
85        appendToObjectList(new ObjectNumberFixedLength("Method Symbol", 1));
86        appendToObjectList(new ObjectByteArraySizeTerminated("Encryption Data"));
87    }
88}

[all classes][org.farng.mp3.id3]
EMMA 2.0.5312 (C) Vladimir Roubtsov