forked from UoEMainLibrary/DSpace
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDatashareDataset.java
More file actions
111 lines (87 loc) · 2.7 KB
/
Copy pathDatashareDataset.java
File metadata and controls
111 lines (87 loc) · 2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/**
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
*
* http://www.dspace.org/license/
*/
package org.dspace.content.datashare;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.OneToOne;
import jakarta.persistence.Table;
import jakarta.persistence.Transient;
import org.dspace.content.DSpaceObject;
import org.dspace.content.DSpaceObjectLegacySupport;
import org.dspace.content.Item;
import org.dspace.content.datashare.service.DatashareDatasetService;
import org.dspace.content.factory.ContentServiceFactory;
import org.dspace.core.Constants;
/**
* DataShare item dataset. That is a zip file that contains all item bitstreams.
*/
@Entity
@Table(name = "dataset")
public class DatashareDataset extends DSpaceObject implements DSpaceObjectLegacySupport {
@Column(name = "id", insertable = false, updatable = false)
private Integer legacyId;
@OneToOne(optional = false)
@JoinColumn(name = "item_id")
private Item item = null;
@Column(name = "file_name")
private String fileName = null;
@Column(name = "checksum")
private String checksum;
@Column(name = "checksum_algorithm")
private String checkSumAlgorithm;
@Transient
private transient DatashareDatasetService datashareDatasetService;
public DatashareDataset() {
}
public Item getItem() {
return item;
}
public void setItem(Item item) {
this.item = item;
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public String getChecksum() {
return checksum;
}
public void setChecksum(String checksum) {
this.checksum = checksum;
}
public String getCheckSumAlgorithm() {
return checkSumAlgorithm;
}
public void setCheckSumAlgorithm(String checkSumAlgorithm) {
this.checkSumAlgorithm = checkSumAlgorithm;
}
public void setLegacyId(Integer legacyId) {
this.legacyId = legacyId;
}
@Override
public Integer getLegacyId() {
return this.legacyId;
}
@Override
public int getType() {
return Constants.DATASHARE_DATASET;
}
@Override
public String getName() {
return fileName;
}
public DatashareDatasetService getDatashareDatasetService() {
if (datashareDatasetService == null) {
datashareDatasetService = ContentServiceFactory.getInstance().getDatashareDatasetService();
}
return datashareDatasetService;
}
}