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

COVERAGE SUMMARY FOR SOURCE FILE [FrameBodyCRM.java]

nameclass, %method, %block, %line, %
FrameBodyCRM.java0%   (0/1)0%   (0/8)0%   (0/67)0%   (0/20)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class FrameBodyCRM0%   (0/1)0%   (0/8)0%   (0/67)0%   (0/20)
FrameBodyCRM (): void 0%   (0/1)0%   (0/3)0%   (0/2)
FrameBodyCRM (FrameBodyCRM): void 0%   (0/1)0%   (0/4)0%   (0/2)
FrameBodyCRM (RandomAccessFile): void 0%   (0/1)0%   (0/6)0%   (0/3)
FrameBodyCRM (String, String, byte []): void 0%   (0/1)0%   (0/15)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)
getOwner (String): void 0%   (0/1)0%   (0/5)0%   (0/2)
setupObjectList (): void 0%   (0/1)0%   (0/19)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.ObjectStringNullTerminated;
6 
7import java.io.IOException;
8import java.io.RandomAccessFile;
9 
10/**
11 * <h3>4.20. Encrypted meta frame</h3>
12 * <p/>
13 * <p class=t> This frame contains one or more encrypted frames. This enables protection of copyrighted information such
14 * as pictures and text, that people might want to pay extra for. Since standardisation of such an encryption scheme is
15 * beyond this document, all "CRM" frames begin with a terminated string with a <a href="#url">URL</a> containing an
16 * email address, or a link to a location where an email adress can be found, that belongs to the organisation
17 * responsible for this specific encrypted meta frame. </p>
18 * <p/>
19 * <p class=t> Questions regarding the encrypted frame should be sent to the indicated email address. If a $00 is found
20 * directly after the 'Frame size', the whole frame should be ignored, and preferably be removed. The 'Owner identifier'
21 * is then followed by a short content description and explanation as to why it's encrypted. After the
22 * 'content/explanation' description, the actual encrypted block follows. </p>
23 * <p/>
24 * <p class=t>
25 * <p/>
26 * When an ID3v2 decoder encounters a "CRM" frame, it should send the datablock to the 'plugin' with the corresponding
27 * 'owner identifier' and expect to receive either a datablock with one or several ID3v2 frames after each other or an
28 * error. There may be more than one "CRM" frames in a tag, but only one with the same 'owner identifier'. </p>
29 * <p/>
30 * <p><center> <table border=0> <tr><td nowrap>Encrypted meta frame</td><td rowspan=5>&nbsp;</td><td
31 * width="100%">"CRM"</td></tr> <tr><td>Frame size</td><td>$xx xx xx</td></tr> <tr><td>Owner
32 * identifier</td><td>&lt;textstring&gt; $00 (00)</td></tr>
33 * <p/>
34 * <tr><td>Content/explanation</td><td>&lt;textstring&gt; $00 (00)</td></tr> <tr><td>Encrypted
35 * datablock</td><td>&lt;binary data&gt;</td></tr> </table> </center>
36 *
37 * @author Eric Farng
38 * @version $Revision: 1.4 $
39 */
40public class FrameBodyCRM extends AbstractID3v2FrameBody {
41 
42    /**
43     * Creates a new FrameBodyCRM object.
44     */
45    public FrameBodyCRM() {
46        super();
47    }
48 
49    /**
50     * Creates a new FrameBodyCRM object.
51     */
52    public FrameBodyCRM(final FrameBodyCRM body) {
53        super(body);
54    }
55 
56    /**
57     * Creates a new FrameBodyCRM object.
58     */
59    public FrameBodyCRM(final String owner, final String description, final byte[] data) {
60        setObject("Owner", owner);
61        setObject("Description", description);
62        setObject("Encrypted datablock", data);
63    }
64 
65    /**
66     * Creates a new FrameBodyCRM object.
67     */
68    public FrameBodyCRM(final RandomAccessFile file) throws IOException, InvalidTagException {
69        this.read(file);
70    }
71 
72    public String getIdentifier() {
73        return "CRM" + ((char) 0) + getOwner();
74    }
75 
76    public String getOwner() {
77        return (String) getObject("Owner");
78    }
79 
80    public void getOwner(final String description) {
81        setObject("Owner", description);
82    }
83 
84    protected void setupObjectList() {
85        appendToObjectList(new ObjectStringNullTerminated("Owner"));
86        appendToObjectList(new ObjectStringNullTerminated("Description"));
87        appendToObjectList(new ObjectByteArraySizeTerminated("Encrypted datablock"));
88    }
89}

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