code: public static void touchSingleResource(
          CmsObject cms,
          String resourceName,
          long timeStamp,
          boolean recursive,
          boolean correctDate,
          boolean touchContent) throws CmsException {
  
          CmsResource sourceRes = cms.readResource(resourceName, CmsResourceFilter.ALL);
          if (!correctDate) {
              // no date value entered, use current resource modification date
              timeStamp = sourceRes.getDateLastModified();
          }
          cms.setDateLastModified(resourceName, timeStamp, recursive);
  
          if (touchContent) {
              if (sourceRes.isFile()) {
                  hardTouch(cms, sourceRes);
              } else if (recursive) {
                  Iterator<CmsResource> it = cms.readResources(resourceName, CmsResourceFilter.ALL, true).iterator();
                  while (it.hasNext()) {
                      CmsResource subRes = it.next();
                      if (subRes.isFile()) {
                          hardTouch(cms, subRes);
                      }
                  }
              }
          }
      }
docs: Performs a touch operation for a single resource.<p>
  
  @param resourceName the resource name of the resource to touch
  @param timeStamp the new time stamp
  @param recursive the flag if the touch operation is recursive
  @param correctDate the flag if the new time stamp is a correct date
  @param touchContent if the content has to be rewritten
  
  @throws CmsException if touching the resource fails