code: public void update(CmsObject cms, CmsUUID id, CmsResourceFilter filter) throws CmsException {
  
          try {
              CmsResource resource = cms.readResource(id, filter);
  
              CmsResource parent = cms.readParentFolder(id);
              CmsUUID parentId = parent.getStructureId();
              Item resourceItem = getItem(id);
              if (resourceItem != null) {
                  fillProperties(cms, resourceItem, resource, parentId);
                  if (parentId != null) {
                      setParent(resource.getStructureId(), parentId);
                  }
              } else {
                  addTreeItem(cms, resource, parentId);
              }
          } catch (CmsVfsResourceNotFoundException e) {
              removeItemRecursively(id);
              LOG.debug(e.getLocalizedMessage(), e);
          }
      }
docs: Updates the item for the given structure id.<p>
  
  @param cms the CMS context
  @param id the structure id
  @param filter the resource filter used for reading the resource
  
  @throws CmsException if something goes wrong