Skip to content

Commit

Permalink
a few typos. #10352
Browse files Browse the repository at this point in the history
  • Loading branch information
landreev committed Apr 30, 2024
1 parent 6d1f70a commit 1efdf9c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
20 changes: 10 additions & 10 deletions src/main/java/edu/harvard/iq/dataverse/DatasetServiceBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -861,11 +861,11 @@ public Dataset setDatasetFileAsThumbnail(Dataset dataset, DataFile datasetFileTh
return null;
}
// Just in case the previously designated thumbnail for the dataset was
// a "custom" kind, i.e. an uploaded "dataset_logo" file, we just try
// to delete it, and all the associated caches here (because it is otherwise
// useless, if we are no longer using it for the dataset thumbnail). If that
// was not the case, there will be an exception in the server log - but it
// is harmless.
// a "custom" kind, i.e. an uploaded "dataset_logo" file, the following method
// will try to delete it, and all the associated caches here (because there
// are no other uses for the file). This method is apparently called in all
// cases, without trying to check if the dataset was in fact using a custom
// logo; probably under the assumption that it can't hurt.
DatasetUtil.deleteDatasetLogo(dataset);
dataset.setThumbnailFile(datasetFileThumbnailToSwitchTo);
dataset.setUseGenericThumbnail(false);
Expand All @@ -879,11 +879,11 @@ public Dataset clearDatasetLevelThumbnail(Dataset dataset) {
}

// Just in case the thumbnail that was designated for the dataset was
// a "custom logo" kind, i.e. an uploaded "dataset_logo" file, we just try
// to delete it, and all the associated caches here (because it is otherwise
// useless, if we are no longer using it for the dataset thumbnail). If that
// was not the case, there will be an exception in the server log - but it
// is harmless:
// a "custom logo" kind, i.e. an uploaded "dataset_logo" file, the following method
// will try to delete it, and all the associated caches here (because there
// are no other uses for the file). This method is apparently called in all
// cases, without trying to check if the dataset was in fact using a custom
// logo; probably under the assumption that it can't hurt.
DatasetUtil.deleteDatasetLogo(dataset);

// Clear any designated thumbnails for the dataset:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ private static boolean generateImageThumbnailFromInputStream(StorageIO<DataFile>
try {
storageIO.deleteAuxObject(THUMBNAIL_SUFFIX + size);
} catch (IOException ioex) {
logger.fine("Failed attempt to delete the result of a failed thumbnail rescaling; this is most likely ok - for ex., because it was never createtd in the first place.");
logger.fine("Failed attempt to delete the result of a failed thumbnail rescaling; this is most likely ok - for ex., because it was never created in the first place.");
}
}
}
Expand Down Expand Up @@ -866,7 +866,7 @@ public static String generatePDFThumbnailFromFile(String fileLocation, int size)

// generate the thumbnail for the requested size, *using the already scaled-down
// 400x400 png version, above*:
// (the "exists()" check below appears to be unncessary - we've already checked early on - ?)
// (the "exists()" check below appears to be unnecessary - we've already checked early on - ?)
if (!((new File(thumbFileLocation)).exists())) {
thumbFileLocation = runImageMagick(imageMagickExec, previewFileLocation, thumbFileLocation, size, "png");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ public static boolean deleteDatasetLogo(Dataset dataset) {
storageIO.deleteAuxObject(datasetLogoThumbnail + thumbExtension + ImageThumbConverter.DEFAULT_CARDIMAGE_SIZE);

} catch (IOException ex) {
logger.info("Failed to delete dataset logo: " + ex.getMessage());
logger.fine("Failed to delete dataset logo: " + ex.getMessage() +
" (this is most likely harmless; this method is often called without checking if the custom dataset logo was in fact present)");
return false;
}
return true;
Expand Down

0 comments on commit 1efdf9c

Please sign in to comment.