Check for problems with new/deleted folders in the publish selection.<p>

@param resourceIds the ids of the resources selected for publishing
@return true if there are problems with nested
345269
public boolean checkForProblems(Set<CmsUUID> resourceIds) {

        List<CmsPublishResource> pubResources = new ArrayList<CmsPublishResource>();
        Set<CmsUUID> publishIds = getResourcesToPublish();
        for (CmsUUID publishId : publishIds) {
            pubResources.add(m_model.getPublishResources().get(publishId));
        }
        for (CmsPublishResource pubResource : pubResources) {
            String parentPath = CmsResource.getParentFolder(pubResource.getName());
            CmsPublishResource parent = m_model.getPublishResourcesByPath().get(parentPath);
            if (parent != null) {
                boolean parentIsNew = parent.getResourceState().isNew();
                boolean parentIsDeleted = parent.getResourceState().isDeleted();
                if (parentIsNew || parentIsDeleted) {
                    if (!resourceIds.contains(parent.getId())) {
                        String title = Messages.get().key(Messages.ERR_CANT_PUBLISH_RESOURCE_TITLE_0);
                        String message = null;
                        if (parentIsNew) {
                            message = Messages.get().key(
                                Messages.ERR_PUBLISH_CANT_PUBLISH_NEW_RESOURCE_2,
                                pubResource.getName(),
                                parent.getName());
                        }
                        if (parentIsDeleted) {
                            message = Messages.get().key(
                                Messages.ERR_PUBLISH_CANT_PUBLISH_DELETED_RESOURCE_2,
                                pubResource.getName(),
                                parent.getName());
                        }
                        CmsAlertDialog alert = new CmsAlertDialog(title, message);
                        alert.center();
                        return true;
                    }
                }
            }
        }
        return false;
    }
1161889
private static void checkResource(final List<String> resources, final Pattern searchPattern, final String resourceName) {
        if (searchPattern.matcher(resourceName).matches()) {
            resources.add(resourceName);
        }
    }
11554
protected static boolean isFolder(CmsResource resource) throws CmsLoaderException {

        I_CmsResourceType resourceType = OpenCms.getResourceManager().getResourceType(resource.getTypeId());
        return resourceType.isFolder();
    }
206728
private boolean isFakePath(String resourcename) {

        for (String folder : FOLDERS) {
            if (matchPath(folder, resourcename) || matchParentPath(folder, resourcename)) {
                return true;
            }
        }
        return false;
    }
482538
public static void checkRemoveOK(Resource resource) throws IOException {
	if (!resource.exists()) throw new IOException("can't delete resource " + resource + ", resource does not exist");
	if (!resource.canWrite()) throw new IOException("can't delete resource " + resource + ", no access");

    }
1201906
protected void deleteConflictingResources(CmsObject cms, CmsModule module, Map<CmsUUID, CmsUUID> conflictingIds)
    throws CmsException, Exception {

        CmsProject conflictProject = cms.createProject(
            "Deletion of conflicting resources for " + module.getName(),
            "Deletion of conflicting resources for " + module.getName(),
            OpenCms.getDefaultUsers().getGroupAdministrators(),
            OpenCms.getDefaultUsers().getGroupAdministrators(),
            CmsProject.PROJECT_TYPE_TEMPORARY);
        CmsObject deleteCms = OpenCms.initCmsObject(cms);
        deleteCms.getRequestContext().setCurrentProject(conflictProject);
        for (CmsUUID vfsId : conflictingIds.values()) {
            CmsResource toDelete = deleteCms.readResource(vfsId, CmsResourceFilter.ALL);
            lock(deleteCms, toDelete);
            deleteCms.deleteResource(toDelete, CmsResource.DELETE_PRESERVE_SIBLINGS);
        }
        OpenCms.getPublishManager().publishProject(deleteCms);
        OpenCms.getPublishManager().waitWhileRunning();
    }
1363731
public boolean shouldClearAll(List<CmsPublishedResource> publishedResources) {

        for (CmsPublishedResource pubRes : publishedResources) {
            for (String clearPath : m_clearAll) {
                if (CmsStringUtil.isPrefixPath(clearPath, pubRes.getRootPath())) {
                    return true;
                }
            }
        }
        return false;
    }
1131255
public boolean hasPermissionsById(String id, String... permissions) {
        List<Permission> resolvedPermissions = Lists.newArrayListWithCapacity(permissions.length);
        for (String permission : permissions) {
            resolvedPermissions.add(getPermissionResolver().resolvePermission(permission));
        }
        return hasPermissionsById(id, resolvedPermissions);
    }
796219
public boolean directoryExists(File[] files) {
        for (int i = 0; i < files.length; i++) {
            if (files[i].isDirectory()) {
                return true;
            }
        }
        return false;
    }
293287
private boolean isInPaths(final CmsResource resource) {

        boolean result = false;
        String resourcePath = getCms().getSitePath(resource);
        for (String path : m_paths) {
            if (resourcePath.startsWith(path)) {
                result = true;
                break;
            }
        }
        return result;

    }
668049
protected boolean remove(CmsResource resource) {

        // it is essential that this method is only visible within the db package!
        boolean ret = m_fileList.remove(resource);
        ret |= m_folderList.remove(resource);
        ret |= m_deletedFolderList.remove(resource);
        return ret;
    }
1319432
protected boolean resourceIsValid(CmsResource resource) {

        if (!resource.getRootPath().startsWith(m_basePath)) {
            return false;
        }
        if (m_requireFile & resource.isFolder()) {
            return false;
        }
        if (m_requireFolder & resource.isFile()) {
            return false;
        }
        return true;
    }
1311143
protected void updateCurrentFolder(Collection<CmsUUID> removeIds) {

        m_fileTable.update(removeIds, true);
        CmsObject cms = A_CmsUI.getCmsObject();
        try {
            // current folder may be filtered, so we clear the filters and restore them later
            // to make updates work for filtered out resources
            m_fileTable.saveFilters();
            m_fileTable.clearFilters();
            CmsResource folder = cms.readResource(m_currentFolder, FOLDERS);
            List<CmsResource> childResources = cms.readResources(cms.getSitePath(folder), FILES_N_FOLDERS, false);
            Set<CmsUUID> ids = new HashSet<CmsUUID>();
            for (CmsResource child : childResources) {
                ids.add(child.getStructureId());
            }
            m_fileTable.update(ids, false);
        } catch (CmsException e) {
            CmsErrorDialog.showErrorDialog(e);
            LOG.error(e.getLocalizedMessage(), e);
        } finally {
            m_fileTable.restoreFilters();
        }
    }
466908
public boolean hasPermissionsById(String id, Permission... permissions) {
        return hasPermissionsById(id, Arrays.asList(permissions));
    }
1322316
private boolean isOnlyFolders(String types) {

        boolean result = true;
        for (String type : types.split("[, ]+")) {
            try {
                if (!OpenCms.getResourceManager().getResourceType(type).isFolder()) {
                    result = false;
                    break;
                }
            } catch (CmsLoaderException e) {
                // ignore
            }
        }
        return result;
    }
1318996
@Override
    public boolean hasStableIds() {
        Collection<? extends Binder<?, ?>> allBinders = getAllBinders();
        if (allBinders.size() == 1) {
            // Save an allocation by checking for List first.
            if (allBinders instanceof List) {
                //noinspection unchecked
                return ((List<Binder<?, ?>>) allBinders).get(0).hasStableIds();
            }
            return allBinders.iterator().next().hasStableIds();
        }
        // Can't possibly have stable IDs if we have multiple binders.
        return false;
    }
493756
protected boolean isDirectory(Resource directory) {
	if (directory.exists()) return directory.isDirectory();
	try {
	    directory.createDirectory(true);
	    return true;
	}
	catch (IOException e) {
	    e.printStackTrace(getErrWriter());
	}
	return false;
    }