Get resource metadata for a resource name

@param resourceName Name of the resource
@return Resource metadata for this name
@throws RuntimException if the resource name doesn't exist
3461
public ResourceMetadata getResourceMetadata(String resourceName) {
    if (!resourceMetadataMap.containsKey(resourceName)) {
      throw new RuntimeException("No resource metadata for " + resourceName);
    }
    return resourceMetadataMap.get(resourceName);
  }
671321
@Override
	public Set<String> getResourceNames(String dirName) {
		Set<String> resourceNames = new TreeSet<>();

		if (generatorRegistry.isPathGenerated(dirName)) {
			List<ResourceBrowser> browsers = new ArrayList<>();
			browsers.addAll(resourceGeneratorInfoProviders);
			for (ResourceBrowser rsBrowser : browsers) {

				if (rsBrowser instanceof ResourceGenerator) {
					ResourceGenerator rsGeneratorBrowser = (ResourceGenerator) rsBrowser;
					if (rsGeneratorBrowser.getResolver().matchPath(dirName)) {
						resourceNames.addAll(rsBrowser.getResourceNames(dirName));
						break;
					}
				}
			}
		} else {
			resourceNames = servletCtxResourceBrowser.getResourceNames(dirName);
		}

		return resourceNames;
	}
827666
@Override
    public ICodeBaseEntry lookupResource(String resourceName) {
        if (!resourceName.equals(getResourceName())) {
            return null;
        }

        return new SingleFileCodeBaseEntry(this);
    }
1086414
public static String getClassName(String resourceName)
    {
        String className = resourceName.replace(File.separatorChar, '.');
        if (className.length() > 7)
        {
            className = className.substring(0, className.length() - 6);
        }
        return className;
    }
1333156
def get_resource(self, name):
        ''

        if name in self.resources:
            return self.resources[name]
        elif name in self.pushable_resources:
            return self.pushable_resources[name]
        else:
            return False
502265
public function getMetadataByResourceName($resourceName)
    {
        $this->getAllMetadata();

        if (!isset($this->resourceClassMap[$resourceName])) {
            throw Exception::resourceNotFound($resourceName);
        }

        return $this->loadedMetadata[$this->resourceClassMap[$resourceName]];
    }
837386
private CmsResource readResource(String resourceName) throws CmsException {

        CmsResource resource = null;
        try {
            resource = getCms().readResource(resourceName, CmsResourceFilter.ALL);
        } catch (CmsVfsResourceNotFoundException e) {
            throw new CmsVfsResourceNotFoundException(
                Messages.get().container(
                    Messages.ERR_RESOURCE_DOES_NOT_EXIST_3,
                    resourceName,
                    getCms().getRequestContext().getCurrentProject().getName(),
                    getCms().getRequestContext().getSiteRoot()),
                e);
        }
        return resource;
    }
338056
public static String getExtension(String resourceName) {

        String result = null;
        if (!resourceName.endsWith("/")) {
            // folders don't have any extension
            resourceName = CmsResource.getName(resourceName);
            int index = resourceName.lastIndexOf(".") + 1;
            if ((index > 0) && (index < resourceName.length())) {
                result = resourceName.substring(index).toLowerCase();
            }
        }

        return result;
    }
1254860
public static List<String> getResourceLines(String resourceName) throws IOException {
        InputStreamReader isreader = null;
        BufferedReader reader = null;
        try {
            isreader = new InputStreamReader(Util.class.getResourceAsStream(resourceName));
            reader = new BufferedReader(isreader);
            List<String> lines = new ArrayList<String>();
            String tmp;
            while ((tmp = reader.readLine()) != null) {
                lines.add(tmp);
            }
            return lines;
        } finally {
            closeQuietly(reader);
            closeQuietly(isreader);
        }
    }
131746
private List<RepositoryResource> getResourcesForName(String resourceName) {
        List<RepositoryResource> results = new ArrayList<>();
        try {
            results.addAll(repositoryConnection.getMatchingEsas(FilterableAttribute.SYMBOLIC_NAME, resourceName));
            results.addAll(repositoryConnection.getMatchingEsas(FilterableAttribute.LOWER_CASE_SHORT_NAME, resourceName.toLowerCase()));
            results.addAll(repositoryConnection.getMatchingSamples(FilterableAttribute.LOWER_CASE_SHORT_NAME, resourceName.toLowerCase()));
        } catch (RepositoryBackendException e) {
            // Don't worry if we fail to contact the repository
            // worst case is we report a resource as missing rather than available on another version/edition
        }
        return results;
    }
764983
@Override
    public Enumeration<URL> getResources(String name) throws IOException {
        if (this.rootClassLoader == null) {
            return findResources(name);
        }
        return new ResourceEnumeration(this.rootClassLoader.getResources(name),
                findResources(name));
    }
745981
public static ORule.ResourceGeneric getResourceGeneric(String name)
	{
		String shortName = Strings.beforeFirst(name, '.');
		if(Strings.isEmpty(shortName)) shortName = name;
		ORule.ResourceGeneric value = ORule.ResourceGeneric.valueOf(shortName);
		if(value==null) value = ORule.mapLegacyResourceToGenericResource(name);
		return value;
	}
689619
public ResourceMetaData getResourceMetaData(Resource resource)
    {
        Object o=resource.getAssociate();
        if (o instanceof ResourceMetaData)
            return (ResourceMetaData)o;
        return new ResourceMetaData(resource);
    }
1352366
public static String getNameForClassloaderResource(String resourceName) {
        String fileName = resourceName;
        if (resourceName.indexOf('/') != -1) {
            fileName = resourceName.substring(resourceName.lastIndexOf('/') + 1, resourceName.length());
        }
        return fileName;
    }
472061
public InputStream getResourceAsStream(String resourceName, BeanContextChild child) throws IllegalArgumentException
	{
		if (resourceName == null || child == null)
		{
			throw new NullPointerException();
		}
		if (!contains(child))
		{
			throw new IllegalArgumentException(Messages.getString("beans.6D"));
		}

		return ClassLoader.getSystemResourceAsStream(resourceName);
	}
116098
public InputStream get(String name)
	{
		InputStream ret;

		if(name == null)
			throw new NullPointerException("name is null");
		if((ret = loader.getResourceAsStream(prefix + name))==null)
			throw new ResourceException("Unable to find resource for " + name);
		return ret;
	}
487059
public String getMappingForResourceType(String resourceType) {

        String[] resourceTypeParams = getResourceTypes().get(resourceType);
        if (resourceTypeParams == null) {
            return null;
        } else {
            return resourceTypeParams[1];
        }
    }