From 6e164456406b114727cd5630533d7eed9fdb2190 Mon Sep 17 00:00:00 2001 From: Igor Vinokur Date: Mon, 19 Feb 2018 08:30:37 +0000 Subject: [PATCH] CHE-8575: Do not show .che folder in project explorer (#8758) Do not show .che folder in project explorer. When applying a code formatter for workspace .che folder appears in the project explorer as a project. --- .../impl/OnWorkspaceStartProjectInitializer.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/wsagent/che-core-api-project/src/main/java/org/eclipse/che/api/project/server/impl/OnWorkspaceStartProjectInitializer.java b/wsagent/che-core-api-project/src/main/java/org/eclipse/che/api/project/server/impl/OnWorkspaceStartProjectInitializer.java index 591f8569515..17e4b247794 100644 --- a/wsagent/che-core-api-project/src/main/java/org/eclipse/che/api/project/server/impl/OnWorkspaceStartProjectInitializer.java +++ b/wsagent/che-core-api-project/src/main/java/org/eclipse/che/api/project/server/impl/OnWorkspaceStartProjectInitializer.java @@ -11,6 +11,7 @@ package org.eclipse.che.api.project.server.impl; import static org.eclipse.che.api.fs.server.WsPathUtils.ROOT; +import static org.eclipse.che.api.project.shared.Constants.CHE_DIR; import java.util.ArrayList; import java.util.List; @@ -24,6 +25,7 @@ import org.eclipse.che.api.core.ServerException; import org.eclipse.che.api.core.model.workspace.config.ProjectConfig; import org.eclipse.che.api.fs.server.FsManager; +import org.eclipse.che.api.fs.server.WsPathUtils; import org.eclipse.che.api.project.server.handlers.ProjectInitHandler; @Singleton @@ -60,10 +62,12 @@ private void initializeRegisteredProjects() throws ServerException { } } - private void initializeNotRegisteredProjects() throws ServerException { - for (String wsPath : fsManager.getDirWsPaths(ROOT)) { - projectConfigRegistry.putIfAbsent(wsPath, true, true); - } + private void initializeNotRegisteredProjects() { + fsManager + .getDirWsPaths(ROOT) + .stream() + .filter(wsPath -> !WsPathUtils.resolve(ROOT, CHE_DIR).equals(wsPath)) + .forEach(wsPath -> projectConfigRegistry.putIfAbsent(wsPath, true, true)); } private void firePostInitializationHandlers()