Added Android code
[wl-app.git] / Android / r2-streamer / r2-parser / src / main / java / org / readium / r2_streamer / model / publication / Encryption.java
diff --git a/Android/r2-streamer/r2-parser/src/main/java/org/readium/r2_streamer/model/publication/Encryption.java b/Android/r2-streamer/r2-parser/src/main/java/org/readium/r2_streamer/model/publication/Encryption.java
new file mode 100755 (executable)
index 0000000..568b0a8
--- /dev/null
@@ -0,0 +1,83 @@
+package org.readium.r2_streamer.model.publication;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * Created by gautam chibde on 18/5/17.
+ */
+
+public class Encryption implements Serializable {
+    private static final long serialVersionUID = 333647343242776147L;
+
+    private String scheme;
+    private String profile;
+    private String algorithm;
+    private String compression;
+    private int originalLength;
+
+    public Encryption() {
+    }
+
+    @Override
+    public String toString() {
+        return "Encryption{" +
+                "scheme='" + scheme + '\'' +
+                ", profile='" + profile + '\'' +
+                ", algorithm='" + algorithm + '\'' +
+                ", compression='" + compression + '\'' +
+                ", originalLength=" + originalLength +
+                '}';
+    }
+
+    public static Encryption getEncryptionFormFontFilePath(
+            String path,
+            List<Encryption> encryptions) {
+        for (Encryption encryption : encryptions) {
+            if (encryption.getProfile().equalsIgnoreCase(path)) {
+                return encryption;
+            }
+        }
+        return null;
+    }
+
+    public String getScheme() {
+        return scheme;
+    }
+
+    public void setScheme(String scheme) {
+        this.scheme = scheme;
+    }
+
+    public String getProfile() {
+        return profile;
+    }
+
+    public void setProfile(String profile) {
+        this.profile = profile;
+    }
+
+    public String getAlgorithm() {
+        return algorithm;
+    }
+
+    public void setAlgorithm(String algorithm) {
+        this.algorithm = algorithm;
+    }
+
+    public String getCompression() {
+        return compression;
+    }
+
+    public void setCompression(String compression) {
+        this.compression = compression;
+    }
+
+    public int getOriginalLength() {
+        return originalLength;
+    }
+
+    public void setOriginalLength(int originalLength) {
+        this.originalLength = originalLength;
+    }
+}