aboutsummaryrefslogtreecommitdiff
path: root/DocumentService/src/eu/stork/documentservice/model/DocumentModel.java
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2016-04-08 07:50:20 +0200
committerThomas Lenz <tlenz@iaik.tugraz.at>2016-04-08 07:50:20 +0200
commit50c500dd107d88988cbee8207c91a16b321d6136 (patch)
tree6abd06e3f126866534e155e40c2f7e933b5357d3 /DocumentService/src/eu/stork/documentservice/model/DocumentModel.java
parentec62813f4c0e8b3002d46f7bc315e7a27d720125 (diff)
parent41882a0c5601dda478c2749ac99c2087b864c912 (diff)
downloadmoa-id-spss-50c500dd107d88988cbee8207c91a16b321d6136.tar.gz
moa-id-spss-50c500dd107d88988cbee8207c91a16b321d6136.tar.bz2
moa-id-spss-50c500dd107d88988cbee8207c91a16b321d6136.zip
Merge tag 'MOA-ID-3.1.0' into development_preview
JoinUp Release
Diffstat (limited to 'DocumentService/src/eu/stork/documentservice/model/DocumentModel.java')
-rw-r--r--DocumentService/src/eu/stork/documentservice/model/DocumentModel.java122
1 files changed, 0 insertions, 122 deletions
diff --git a/DocumentService/src/eu/stork/documentservice/model/DocumentModel.java b/DocumentService/src/eu/stork/documentservice/model/DocumentModel.java
deleted file mode 100644
index 10ae8a189..000000000
--- a/DocumentService/src/eu/stork/documentservice/model/DocumentModel.java
+++ /dev/null
@@ -1,122 +0,0 @@
-package eu.stork.documentservice.model;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Date;
-
-import eu.stork.documentservice.exceptions.ModelException;
-
-/**
- * The document model class
- * @author sveinbjorno
- *
- */
-public class DocumentModel {
- private String docid;
- private byte[] document;
- private String filename;
- private String mimetype;
- private String reicevercert;
- private String enckey;
- private String enciv;
- private Date created;
- private Date updated;
- private Date deleted;
-
- public String getDocid() {
- return docid;
- }
- public void setDocid(String docid) {
- this.docid = docid;
- }
- public byte[] getDocument() {
- return document;
- }
- public void setDocument(byte[] document) {
- this.document = document;
- }
- public String getFilename() {
- return filename;
- }
- public void setFilename(String filename) {
- this.filename = filename;
- }
- public String getMimetype() {
- return mimetype;
- }
- public void setMimetype(String mimetype) {
- this.mimetype = mimetype;
- }
- public String getReicevercert() {
- return reicevercert;
- }
- public void setReicevercert(String reicevercert) {
- this.reicevercert = reicevercert;
- }
- public String getEnckey() {
- return enckey;
- }
- public void setEnckey(String enckey) {
- this.enckey = enckey;
- }
- public String getEnciv() {
- return enciv;
- }
- public void setEnciv(String enciv) {
- this.enciv = enciv;
- }
- public Date getCreated() {
- return created;
- }
- public void setCreated(Date created) {
- this.created = created;
- }
- public Date getUpdated() {
- return updated;
- }
- public void setUpdated(Date updated) {
- this.updated = updated;
- }
- public Date getDeleted() {
- return deleted;
- }
- public void setDeleted(Date deleted) {
- this.deleted = deleted;
- }
-
- public InputStream getDataStream()
- {
- if (this.document != null)
- return new ByteArrayInputStream(this.document);
- else
- return null;
- }
-
- public void setDataStream(InputStream stream) throws ModelException
- {
- try {
- this.document = new byte[stream.available()];
- stream.read(this.document);
- } catch (IOException e) {
- throw new ModelException("Unable to parse stream.", e);
- }
- }
-
- public void insertValidate() throws ModelException
- {
- if (this.docid == null || this.docid.isEmpty())
- throw new ModelException("Document ID is null or empty");
- if (this.document == null)
- throw new ModelException("Document is null");
- if (this.mimetype == null || this.mimetype.isEmpty())
- throw new ModelException("MIME type is null or empty.");
- }
-
- public void updateValidate() throws ModelException
- {
- this.insertValidate();
- if (this.created == null)
- throw new ModelException("Created is null");
- }
-}