Coverage Report - org.jaudiotagger.audio.asf.data.EncryptionChunk
 
Classes in this File Line Coverage Branch Coverage Complexity
EncryptionChunk
0%
0/32
0%
0/2
1.083
 
 1  
 package org.jaudiotagger.audio.asf.data;
 2  
 
 3  
 import org.jaudiotagger.audio.asf.util.Utils;
 4  
 
 5  
 import java.math.BigInteger;
 6  
 import java.util.ArrayList;
 7  
 import java.util.Collection;
 8  
 
 9  
 /**
 10  
  * @author eric
 11  
  */
 12  
 public class EncryptionChunk extends Chunk {
 13  
     private String keyID;
 14  
 
 15  
     private String licenseURL;
 16  
     private String protectionType;
 17  
     private String secretData;
 18  
     /**
 19  
      * The read strings.
 20  
      */
 21  
     private final ArrayList<String> strings;
 22  
 
 23  
     /**
 24  
      * Creates an instance.
 25  
      * 
 26  
      * @param chunkLen
 27  
      *            Length of current chunk.
 28  
      */
 29  
     public EncryptionChunk(final BigInteger chunkLen) {
 30  0
         super(GUID.GUID_CONTENT_ENCRYPTION, chunkLen);
 31  0
         this.strings = new ArrayList<String>();
 32  0
         this.secretData = "";
 33  0
         this.protectionType = "";
 34  0
         this.keyID = "";
 35  0
         this.licenseURL = "";
 36  0
     }
 37  
 
 38  
     /**
 39  
      * This method appends a String.
 40  
      * 
 41  
      * @param toAdd
 42  
      *            String to add.
 43  
      */
 44  
     public void addString(final String toAdd) {
 45  0
         this.strings.add(toAdd);
 46  0
     }
 47  
 
 48  
     /**
 49  
      * This method gets the keyID.
 50  
      * @return
 51  
      */
 52  
     public String getKeyID() {
 53  0
         return this.keyID;
 54  
     }
 55  
 
 56  
     /**
 57  
      * This method gets the license URL.
 58  
      * @return
 59  
      */
 60  
     public String getLicenseURL() {
 61  0
         return this.licenseURL;
 62  
     }
 63  
 
 64  
     /**
 65  
      * This method gets the secret data.
 66  
      * @return
 67  
      */
 68  
     public String getProtectionType() {
 69  0
         return this.protectionType;
 70  
     }
 71  
 
 72  
     /**
 73  
      * This method gets the secret data.
 74  
      * @return
 75  
      */
 76  
     public String getSecretData() {
 77  0
         return this.secretData;
 78  
     }
 79  
 
 80  
     /**
 81  
      * This method returns a collection of all {@link String}s which were addid
 82  
      * due {@link #addString(String)}.
 83  
      * 
 84  
      * @return Inserted Strings.
 85  
      */
 86  
     public Collection<String> getStrings() {
 87  0
         return new ArrayList<String>(this.strings);
 88  
     }
 89  
 
 90  
     /**
 91  
      * {@inheritDoc}
 92  
      */
 93  
     @Override
 94  
     public String prettyPrint(final String prefix) {
 95  0
         final StringBuilder result = new StringBuilder(super.prettyPrint(prefix));
 96  0
         result.insert(0, Utils.LINE_SEPARATOR + prefix + " Encryption:"
 97  
                 + Utils.LINE_SEPARATOR);
 98  0
         result.append(prefix).append("        |->keyID ").append(this.keyID).append(
 99  
                 Utils.LINE_SEPARATOR);
 100  0
         result.append(prefix).append("        |->secretData ").append(this.secretData)
 101  
                 .append(Utils.LINE_SEPARATOR);
 102  0
         result.append(prefix).append("        |->protectionType ").append(
 103  
                 this.protectionType).append(Utils.LINE_SEPARATOR);
 104  0
         result.append(prefix).append("        |->licenseURL ").append(this.licenseURL)
 105  
                 .append(Utils.LINE_SEPARATOR);
 106  0
         this.strings.iterator();
 107  0
         for (final String string : this.strings) {
 108  0
             result.append(prefix).append("   |->").append(string).append(Utils.LINE_SEPARATOR);
 109  
         }
 110  0
         return result.toString();
 111  
     }
 112  
 
 113  
     /**
 114  
      * This method appends a String.
 115  
      * 
 116  
      * @param toAdd
 117  
      *            String to add.
 118  
      */
 119  
     public void setKeyID(final String toAdd) {
 120  0
         this.keyID = toAdd;
 121  0
     }
 122  
 
 123  
     /**
 124  
      * This method appends a String.
 125  
      * 
 126  
      * @param toAdd
 127  
      *            String to add.
 128  
      */
 129  
     public void setLicenseURL(final String toAdd) {
 130  0
         this.licenseURL = toAdd;
 131  0
     }
 132  
 
 133  
     /**
 134  
      * This method appends a String.
 135  
      * 
 136  
      * @param toAdd
 137  
      *            String to add.
 138  
      */
 139  
     public void setProtectionType(final String toAdd) {
 140  0
         this.protectionType = toAdd;
 141  0
     }
 142  
 
 143  
     /**
 144  
      * This method adds the secret data.
 145  
      * 
 146  
      * @param toAdd
 147  
      *            String to add.
 148  
      */
 149  
     public void setSecretData(final String toAdd) {
 150  0
         this.secretData = toAdd;
 151  0
     }
 152  
 }