diff --git a/dotCMS/src/enterprise/java/com/dotcms/enterprise/publishing/remote/handler/ContentHandler.java b/dotCMS/src/enterprise/java/com/dotcms/enterprise/publishing/remote/handler/ContentHandler.java index d9a7c6b3d9d..91e7d30c233 100644 --- a/dotCMS/src/enterprise/java/com/dotcms/enterprise/publishing/remote/handler/ContentHandler.java +++ b/dotCMS/src/enterprise/java/com/dotcms/enterprise/publishing/remote/handler/ContentHandler.java @@ -219,7 +219,7 @@ public void handle(final File bundleFolder, final Boolean isHost) throws Excepti List contents = isHost?FileUtil.listFilesRecursively(bundleFolder, new HostBundler().getFileFilter()): FileUtil.listFilesRecursively(bundleFolder, new ContentBundler().getFileFilter()); Collections.sort(contents); - contents = contents.stream().filter(f->f.isFile()).collect(Collectors.toList()); + contents = contents.stream().filter(File::isFile).collect(Collectors.toList()); handleContents(contents, bundleFolder, isHost); HandlerUtil.setExistingContent(config.getId(), existingContentMap); @@ -326,7 +326,8 @@ private void handleContents(final Collection contentsIn, final File folder // if a host does not exist on target, skip content if(ignoreContent(content)){ Contentlet finalContent = content; - Logger.warn(this.getClass(), "Ignoring contentlet:" + content.getIdentifier() + " | " + Try.of(()->finalContent.getTitle()).getOrElse("unknown") + " . Unable to find referenced host id:" + content.getHost()); + Logger.warn(this.getClass(), "Ignoring contentlet:" + content.getIdentifier() + " | " + Try.of( + finalContent::getTitle).getOrElse("unknown") + " . Unable to find referenced host id:" + content.getHost()); continue; } diff --git a/dotCMS/src/enterprise/java/com/dotcms/enterprise/publishing/remote/handler/FolderHandler.java b/dotCMS/src/enterprise/java/com/dotcms/enterprise/publishing/remote/handler/FolderHandler.java index a1dc201edb0..94359e54caf 100644 --- a/dotCMS/src/enterprise/java/com/dotcms/enterprise/publishing/remote/handler/FolderHandler.java +++ b/dotCMS/src/enterprise/java/com/dotcms/enterprise/publishing/remote/handler/FolderHandler.java @@ -183,7 +183,7 @@ private void handleFolders(Collection folders) throws DotPublishingExcepti continue; } - folderName = Try.of(()-> folder.getPath()).getOrNull(); + folderName = Try.of(folder::getPath).getOrNull(); folderId = folderWrapper.getFolderId(); host = folderWrapper.getHost(); @@ -195,8 +195,8 @@ private void handleFolders(Collection folders) throws DotPublishingExcepti //Check Host if exists otherwise create Host localHost = APILocator.getHostAPI().find(host.getIdentifier(), systemUser, false); if(UtilMethods.isEmpty(()->localHost.getIdentifier())){ - Logger.warn(this.getClass(), "Unable to publish folder:" + folderName + ". Unable to find referenced host id:" + folder.getHostId()); - Logger.warn(this.getClass(), "Make sure the host exists with the id:" + folder.getHostId() + " before pushing the folder or run the integrity checker before pushing."); + Logger.warn(FolderHandler.class, "Unable to publish folder:" + folderName + ". Unable to find referenced host id:" + folder.getHostId()); + Logger.warn(FolderHandler.class, "Make sure the host exists with the id:" + folder.getHostId() + " before pushing the folder or run the integrity checker before pushing."); continue; } @@ -333,7 +333,7 @@ else if(!folderId.getAssetName().equals(id.getAssetName())) { final String errorMsg = String.format("An error occurred when processing Folder in '%s': %s", workingOn, e.getMessage()); Logger.error(this.getClass(), errorMsg); - Logger.error(this, "-- Local Folder: " + (UtilMethods.isSet(temp) ? temp.toString() : "- object is null -")); + Logger.error(this, "-- Local Folder: " + (UtilMethods.isSet(temp) ? temp : "- object is null -")); if(UtilMethods.isSet(temp) && UtilMethods.isSet(folderName)) { Logger.error(this, "-- folderName:" + folderName); }