Skip to content

Commit aa75382

Browse files
committed
address review comments - unused imports/method
1 parent 35eac7e commit aa75382

File tree

1 file changed

+0
-57
lines changed

1 file changed

+0
-57
lines changed

src/main/java/edu/harvard/iq/dataverse/ThumbnailServiceWrapper.java

-57
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,19 @@
55
*/
66
package edu.harvard.iq.dataverse;
77

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;
128
import edu.harvard.iq.dataverse.dataaccess.ImageThumbConverter;
139

14-
import static edu.harvard.iq.dataverse.dataset.DatasetUtil.datasetLogoThumbnail;
1510
import edu.harvard.iq.dataverse.search.SolrSearchResult;
16-
import edu.harvard.iq.dataverse.util.FileUtil;
1711
import edu.harvard.iq.dataverse.util.SystemConfig;
1812

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;
2513
import java.util.HashMap;
2614
import java.util.Map;
2715
import java.util.logging.Logger;
2816

2917
import jakarta.ejb.EJB;
3018
import jakarta.enterprise.context.RequestScoped;
31-
import jakarta.faces.view.ViewScoped;
3219
import jakarta.inject.Inject;
3320
import jakarta.inject.Named;
34-
import org.apache.commons.io.IOUtils;
3521

3622
/**
3723
*
@@ -59,49 +45,6 @@ public class ThumbnailServiceWrapper implements java.io.Serializable {
5945
private Map<Long, DvObject> dvobjectViewMap = new HashMap<>();
6046
private Map<Long, Boolean> hasThumbMap = new HashMap<>();
6147

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-
10548
// it's the responsibility of the user - to make sure the search result
10649
// passed to this method is of the Datafile type!
10750
public String getFileCardImageAsBase64Url(SolrSearchResult result) {

0 commit comments

Comments
 (0)