code: public static CmsResource convertRawResource(CmsObject cms, Object input) throws CmsException {
  
          CmsResource result;
          if (input instanceof CmsResource) {
              // input is already a resource
              result = (CmsResource)input;
          } else if (input instanceof String) {
              if (CmsUUID.isValidUUID((String)input)) {
                  // input is a UUID as String
                  result = cms.readResource(CmsUUID.valueOf((String)input));
              } else {
                  // input is a path as String
                  result = cms.readResource(cms.getRequestContext().removeSiteRoot((String)input));
              }
          } else if (input instanceof CmsUUID) {
              // input is a UUID
              result = cms.readResource((CmsUUID)input);
          } else {
              // input seems not really to make sense, try to use it like a String
              result = cms.readResource(String.valueOf(input));
          }
          return result;
      }
docs: Returns a resource created from an Object.<p>
  
  <ul>
  <li>If the input is already a {@link CmsResource}, it is casted to the resource and returned unchanged.
  <li>If the input is a String, the given OpenCms context is used to read a resource with this name from the VFS.
  <li>If the input is a {@link CmsUUID}, the given OpenCms context is used to read a resource with
  this UUID from the VFS.
  <li>Otherwise the input is converted to a String, and then the given OpenCms context is used to read
  a resource with this name from the VFS.
  </ul>
  
  @param cms the current OpenCms user context
  @param input the input to create a resource from
  
  @return a resource created from the given Object
  
  @throws CmsException in case of errors accessing the OpenCms VFS for reading the resource