Skip to content
Permalink
Browse files

Logo / Fix copy op when starting the app, creating a portal or an

harvester.

Related to #4248
  • Loading branch information
fxprunayre committed Jan 10, 2020
1 parent 458ec1e commit 7ef91c6b28c5aba55117e04891e27933c998c3a7
@@ -283,7 +283,7 @@ public void copyLogo(ServiceContext context, String icon,
try {
Path srcPath = locateResource(locateResourcesDir(context), servletContext, appDir, icon);
String extension = Files.getFileExtension(srcPath.getFileName().toString());
try(ResourceHolder src = getImage(context, srcPath.getFileName().toString(), appDir);
try(ResourceHolder src = getImage(context, srcPath.getFileName().toString(), srcPath.getParent());
ResourceHolder des = getWritableImage(context, destName + "." + extension,
logosDir)) {
if (src != null) {
@@ -562,13 +562,10 @@ private void createSiteLogo(String nodeUuid, ServiceContext context, Path appPat
try {
final Resources resources = context.getBean(Resources.class);
Path logosDir = resources.locateLogosDir(context);
// Path logo = logosDir.resolve(nodeUuid + ".png");
// if (!Files.exists(logo)) {
final ServletContext servletContext = context.getServlet().getServletContext();
byte[] logoData = resources.loadImage(servletContext, appPath,
"images/harvesting/GN3.png", new byte[0]).one();
// Files.write(logo, logoData);
// }
Path logo = logosDir.resolve(nodeUuid + ".png");
if (!Files.exists(logo)) {
resources.copyLogo(context, "images" + File.separator + "harvesting" + File.separator + "GN3.png", nodeUuid);
}
} catch (Throwable e) {
logger.error(" Error when setting the logo: " + e.getMessage());
}

0 comments on commit 7ef91c6

Please sign in to comment.
You can’t perform that action at this time.