Skip to content

Commit

Permalink
Revert "revert changes in RefreshLocalVisitor"
Browse files Browse the repository at this point in the history
This reverts commit 241da21.
  • Loading branch information
Michael5601 committed May 21, 2024
1 parent 77ea6aa commit 9640c46
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*******************************************************************************/
package org.eclipse.core.internal.localstore;

import org.eclipse.core.filesystem.ZipFileUtil;
import org.eclipse.core.internal.resources.Container;
import org.eclipse.core.internal.resources.File;
import org.eclipse.core.internal.resources.Folder;
Expand Down Expand Up @@ -247,7 +248,10 @@ protected boolean synchronizeGender(UnifiedTreeNode node, Resource target) throw
return false;
}
} else {
if (!node.isFolder()) {
// if the target is an open zip file (linked folder), gender should not be
// synchronized because the folder state is needed to access the zip file
// content.
if (!node.isFolder() && !ZipFileUtil.isInsideOpenZipFile(target.getStore())) {
folderToFile(node, target);
resourceChanged = true;
return false;
Expand Down Expand Up @@ -294,7 +298,12 @@ public boolean visit(UnifiedTreeNode node) throws CoreException {
return true;
}
} else {
if (node.existsInFileSystem() && !IPath.EMPTY.isValidSegment(node.getLocalName())) {
// if opened zip files contain directories with content, the local name of the
// node contains "/" characters which are needed to properly present the
// contents in the workspace. So this check should not be done when handling zip
// files.
if (node.existsInFileSystem() && !IPath.EMPTY.isValidSegment(node.getLocalName())
&& !ZipFileUtil.isInsideOpenZipFile(target.getStore())) {
String message = NLS.bind(Messages.resources_invalidResourceName, node.getLocalName());
errors.merge(new ResourceStatus(IResourceStatus.INVALID_RESOURCE_NAME, message));
return false;
Expand Down

0 comments on commit 9640c46

Please sign in to comment.