code: protected void performSingleResourceAvailability(
          String resName,
          long releaseDate,
          long expireDate,
          boolean leaveRelease,
          boolean leaveExpire,
          boolean modifyRecursive) throws CmsException {
  
          CmsResource resource = getCms().readResource(resName, CmsResourceFilter.IGNORE_EXPIRATION);
          if (leaveRelease) {
              releaseDate = resource.getDateReleased();
          }
          if (leaveExpire) {
              expireDate = resource.getDateExpired();
          }
          if (expireDate < releaseDate) {
              throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_AVAILABILITY_BAD_TIMEWINDOW_0));
          }
          String resourcePath = getCms().getSitePath(resource);
          // lock resource if auto lock is enabled
          checkLock(resourcePath);
          // modify release and expire date of the resource if needed
          if (!leaveRelease) {
              getCms().setDateReleased(resourcePath, releaseDate, modifyRecursive);
          }
          if (!leaveExpire) {
              getCms().setDateExpired(resourcePath, expireDate, modifyRecursive);
          }
      }
docs: Performs the availability operations on a single resource.<p>
  
  @param resName the VFS path of the resource
  @param releaseDate the new release date
  @param expireDate the new expiration date
  @param leaveRelease if the release date should be left untouched
  @param leaveExpire if the expiration date should be left untouched
  @param modifyRecursive flag indicating if the operation is recursive for folders
  
  @throws CmsException if the availability and notification operations fail