Gets controller class for a resource.

@param resource
Resource that will managed by the controller class.
@return The fully qualified name of the controller class for this
resource and extension.
5214
String getControllerClass(String resource) {
		ControllerFinder finder = new ControllerFinder(config);
		String controllerClass = finder.findResource(resource);
		LOGGER.debug("Controller class: {}", controllerClass);
		return controllerClass;
	}
954453
public Panel getResourcePanel(Resource resource) {
    List<Folder> resourceFolders = new ArrayList<Folder>();
    Resource current = resource;
    Folder folder = current instanceof Folder ? (Folder) current : current == null ? null : current.getParentFolder();
    while (folder != null) {
      resourceFolders.add(folder);
      current = folder;
      folder = current.getParentFolder();
    }
    
    Folder panelFolder = null;
    int panelIndex = resourceFolders.size() - 2;

    if (panelIndex >= 0) {
      panelFolder = resourceFolders.get(panelIndex);
    }

    if (panelFolder != null) {
      return panelDAO.findByRootFolder(panelFolder);
    }
    
    return null;
  }
90607
private Reader getResourceReader(String resource) throws ResourceNotFoundException {
		List<Class<?>> excluded = new ArrayList<>();
		excluded.add(ILessCssResourceGenerator.class);
		return rsReaderHandler.getResource(bundle, resource, false, excluded);
	}
762722
protected function callController($resource)
    {
        $controllerName = $this->getControllerName($resource);

        if ($this->confirm("Do you want me to create a $controllerName controller? [yes|no]"))
        {
            $this->call('generate:controller', [
                'controllerName' => $controllerName,
                '--templatePath' => Config::get("generators::config.scaffold_controller_template_path")
            ]);
        }
    }
788775
@Nullable
    public static InputStream getResourceAsStream(@NotNull String resource) {
        final ClassLoader classLoader = FileUtils.class.getClassLoader();
        final InputStream inputStream = classLoader != null
                ? classLoader.getResourceAsStream(resource)
                : ClassLoader.getSystemResourceAsStream(resource);

        if (inputStream == null) {
            try {
                return new FileInputStream(resource);
            } catch (final FileNotFoundException e) {
                LOGGER.error("Unable to create an Input Stream for " + resource, e);
            }
        }
        return inputStream;
    }
352441
protected function callController($resource)
    {
        $controllerName = $this->getControllerName($resource);

        if ($this->confirm("Do you want me to create a $controllerName controller? [yes|no]"))
        {
            $this->call('generate:controller', compact('controllerName'));
        }
    }
1218226
public static Enumeration<URL> getResources(String resource) {
        Enumeration<URL> urls = null;
        try {
            urls = ClassUtils.getContextClassLoader().getResources(resource);
        } catch (IOException e) {
            //noop
        }
        if (urls == null) {
            try {
                urls = IOUtils.class.getClassLoader().getResources(resource);
            } catch (IOException e) {
                //noop
            }
        }

        if (urls == null) {
            URL url = IOUtils.class.getResource(resource);
            if (url != null) {
                final Iterator<URL> it = Lists.newArrayList(url).iterator();
                urls = new Enumeration<URL>() {
                    public boolean hasMoreElements() {
                        return it.hasNext();
                    }

                    public URL nextElement() {
                        return it.next();
                    }
                };
            }
        }

        if (urls == null) {
            File file = new File(resource);
            if (file.isFile()) {
                try {
                    final Iterator<URL> it = Lists.newArrayList(file.toURI().toURL()).iterator();
                    urls = new Enumeration<URL>() {
                        public boolean hasMoreElements() {
                            return it.hasNext();
                        }

                        public URL nextElement() {
                            return it.next();
                        }
                    };
                } catch (MalformedURLException e) {
                    //no op
                }
            }
        }

        return urls == null ? new Enumeration<URL>() {
            public boolean hasMoreElements() {
                return false;
            }

            public URL nextElement() {
                return null;
            }
        } : urls;
    }
548288
@Override
	public Template getTemplate(String resource) {
		return ThymeleafTemplate.wrap(this.engine, resource, (null == this.config) ? null : this.config.getCharset());
	}
1214074
public function getId($resource): ?string
    {
        assert(get_class($resource) === static::MODEL);
        assert($this->classImplements(static::MODEL, ModelInterface::class) === true);

        /** @var ModelInterface $modelClass */
        $modelClass = static::MODEL;

        $pkName = $modelClass::getPrimaryKeyName();

        return $resource->{$pkName};
    }
1107181
public static Resource wrap(@NotNull Resource resource) {
    return wrap(resource, resource.getValueMap(), resource.getChildren());
  }
605843
public function getAllControllerFromResource($resource)
    {
        $controllerDir = $this->kernel->locateResource($resource);

        $finder = new Finder();
        $finder->name('*Controller.php')->in($controllerDir);

        $controllers = array();
        /** @var SplFileInfo $file */
        foreach ($finder as $file) {
            $controllers[] = $this->getReflectionClassFromFile($file);
        }
        $controllers[] = new \ReflectionClass(UserController::class);
        $controllers[] = new \ReflectionClass(ProfileController::class);
        $controllers[] = new \ReflectionClass(HomeController::class);

        return $controllers;
    }
1186856
@Override
	public Template getTemplate(String resource) {
		if(ObjectUtil.equal(ResourceMode.STRING, this.resourceMode)) {
			return EnjoyTemplate.wrap(this.engine.getTemplateByString(resource));
		}
		return EnjoyTemplate.wrap(this.engine.getTemplate(resource));
	}
501228
protected String toFilename(final Resource resource) throws UnsupportedOperationException {
        if (resource instanceof FileResource) {
            return ((FileResource) resource).getFile().getPath();
        }

        throw new UnsupportedOperationException("Unsupported resource type: " + resource);
    }
298681
public I_CmsResourceLoader getLoader(CmsResource resource) throws CmsLoaderException {

        return getLoader(getResourceType(resource.getTypeId()).getLoaderId());
    }
1100923
public function validatorClass($resource, $modelClass=null)
    {
        if ($modelClass) {
            return $this->findClass($modelClass.'Validator');
        }

        return $this->findClass($this->className($resource).'Validator');
    }
206020
public function getResourceName($controller, $action = null)
    {
        if (isset($action)) {
            return sprintf('controller/%s:%s', $controller, strtolower($action));
        }

        return sprintf('controller/%s', $controller);
    }
1267865
public static File getResourceAsFile(String resource) {
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        try {
            return new File(URLDecoder.decode(cl.getResource(resource)
                    .getFile(), "UTF-8"));
        } catch (UnsupportedEncodingException uee) {
            return null;
        }
    }