|
5 | 5 | */
|
6 | 6 | package edu.harvard.iq.dataverse;
|
7 | 7 |
|
8 |
| -import edu.harvard.iq.dataverse.api.Datasets; |
9 |
| -import edu.harvard.iq.dataverse.dataaccess.DataAccess; |
10 |
| -import edu.harvard.iq.dataverse.dataaccess.StorageIO; |
11 |
| -import edu.harvard.iq.dataverse.dataset.DatasetUtil; |
12 | 8 | import edu.harvard.iq.dataverse.dataaccess.ImageThumbConverter;
|
13 | 9 |
|
14 |
| -import static edu.harvard.iq.dataverse.dataset.DatasetUtil.datasetLogoThumbnail; |
15 | 10 | import edu.harvard.iq.dataverse.search.SolrSearchResult;
|
16 |
| -import edu.harvard.iq.dataverse.util.FileUtil; |
17 | 11 | import edu.harvard.iq.dataverse.util.SystemConfig;
|
18 | 12 |
|
19 |
| -import java.io.IOException; |
20 |
| -import java.io.InputStream; |
21 |
| -import java.nio.file.Files; |
22 |
| -import java.nio.file.Path; |
23 |
| -import java.nio.file.Paths; |
24 |
| -import java.util.Base64; |
25 | 13 | import java.util.HashMap;
|
26 | 14 | import java.util.Map;
|
27 | 15 | import java.util.logging.Logger;
|
28 | 16 |
|
29 | 17 | import jakarta.ejb.EJB;
|
30 | 18 | import jakarta.enterprise.context.RequestScoped;
|
31 |
| -import jakarta.faces.view.ViewScoped; |
32 | 19 | import jakarta.inject.Inject;
|
33 | 20 | import jakarta.inject.Named;
|
34 |
| -import org.apache.commons.io.IOUtils; |
35 | 21 |
|
36 | 22 | /**
|
37 | 23 | *
|
@@ -59,49 +45,6 @@ public class ThumbnailServiceWrapper implements java.io.Serializable {
|
59 | 45 | private Map<Long, DvObject> dvobjectViewMap = new HashMap<>();
|
60 | 46 | private Map<Long, Boolean> hasThumbMap = new HashMap<>();
|
61 | 47 |
|
62 |
| - private String getAssignedDatasetImage(Dataset dataset, int size) { |
63 |
| - if (dataset == null) { |
64 |
| - return null; |
65 |
| - } |
66 |
| - |
67 |
| - DataFile assignedThumbnailFile = dataset.getThumbnailFile(); |
68 |
| - |
69 |
| - if (assignedThumbnailFile != null) { |
70 |
| - Long assignedThumbnailFileId = assignedThumbnailFile.getId(); |
71 |
| - |
72 |
| - if (this.dvobjectThumbnailsMap.containsKey(assignedThumbnailFileId)) { |
73 |
| - // Yes, return previous answer |
74 |
| - //logger.info("using cached result for ... "+assignedThumbnailFileId); |
75 |
| - if (!"".equals(this.dvobjectThumbnailsMap.get(assignedThumbnailFileId))) { |
76 |
| - return this.dvobjectThumbnailsMap.get(assignedThumbnailFileId); |
77 |
| - } |
78 |
| - return null; |
79 |
| - } |
80 |
| - |
81 |
| - String imageSourceBase64 = ImageThumbConverter.getImageThumbnailAsBase64(assignedThumbnailFile, |
82 |
| - size); |
83 |
| - //ImageThumbConverter.DEFAULT_CARDIMAGE_SIZE); |
84 |
| - |
85 |
| - if (imageSourceBase64 != null) { |
86 |
| - this.dvobjectThumbnailsMap.put(assignedThumbnailFileId, imageSourceBase64); |
87 |
| - return imageSourceBase64; |
88 |
| - } |
89 |
| - |
90 |
| - // OK - we can't use this "assigned" image, because of permissions, or because |
91 |
| - // the thumbnail failed to generate, etc... in this case we'll |
92 |
| - // mark this dataset in the lookup map - so that we don't have to |
93 |
| - // do all these lookups again... |
94 |
| - this.dvobjectThumbnailsMap.put(assignedThumbnailFileId, ""); |
95 |
| - |
96 |
| - // TODO: (?) |
97 |
| - // do we need to cache this datafile object in the view map? |
98 |
| - // -- L.A., 4.2.2 |
99 |
| - } |
100 |
| - |
101 |
| - return null; |
102 |
| - |
103 |
| - } |
104 |
| - |
105 | 48 | // it's the responsibility of the user - to make sure the search result
|
106 | 49 | // passed to this method is of the Datafile type!
|
107 | 50 | public String getFileCardImageAsBase64Url(SolrSearchResult result) {
|
|
0 commit comments