code: public String moveToLostAndFound(CmsRequestContext context, CmsResource resource, boolean returnNameOnly)
      throws CmsException {
  
          CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
          String result = null;
          try {
              checkOfflineProject(dbc);
              checkPermissions(dbc, resource, CmsPermissionSet.ACCESS_READ, true, CmsResourceFilter.ALL);
              if (!returnNameOnly) {
                  checkPermissions(dbc, resource, CmsPermissionSet.ACCESS_WRITE, true, CmsResourceFilter.ALL);
              }
              result = m_driverManager.moveToLostAndFound(dbc, resource, returnNameOnly);
          } catch (Exception e) {
              dbc.report(
                  null,
                  Messages.get().container(
                      Messages.ERR_MOVE_TO_LOST_AND_FOUND_1,
                      dbc.removeSiteRoot(resource.getRootPath())),
                  e);
          } finally {
              dbc.clear();
          }
          return result;
      }
docs: Moves a resource to the "lost and found" folder.<p>
  
  The method can also be used to check get the name of a resource
  in the "lost and found" folder only without actually moving the
  the resource. To do this, the <code>returnNameOnly</code> flag
  must be set to <code>true</code>.<p>
  
  In general, it is the same name as the given resource has, the only exception is
  if a resource in the "lost and found" folder with the same name already exists.
  In such case, a counter is added to the resource name.<p>
  
  @param context the current request context
  @param resource the resource to apply this operation to
  @param returnNameOnly if <code>true</code>, only the name of the resource in the "lost and found"
  folder is returned, the move operation is not really performed
  
  @return the name of the resource inside the "lost and found" folder
  
  @throws CmsException if something goes wrong
  
  @see CmsObject#moveToLostAndFound(String)
  @see CmsObject#getLostAndFoundName(String)