<p>parseSource.</p>

@param resourceInfo a {@link javax.ws.rs.container.ResourceInfo} object.
@return a {@link java.lang.String} object.
434222
public static String parseSource(ResourceInfo resourceInfo) {
        if (resourceInfo != null) {
            Class clazz = resourceInfo.getResourceClass();
            if (clazz != null)
                return ClassUtils.toString(clazz, resourceInfo.getResourceMethod());
        }
        return null;
    }
626175
public static String readResource(String path) {
        try {
            File file = ResourceUtil.getResourceFile(path);
            return ResourceUtil.readFromFileIntoString(file);
        } catch (Exception e) {
            throw new DataUtilException("Failed to load resource", e);
        }
    }
437291
public void parse(CmsResource resource) throws CmsException {

        CmsFile file = m_cms.readFile(resource);
        m_resource = resource;
        CmsXmlContent content = CmsXmlContentFactory.unmarshal(m_cms, file);
        parse(content);
    }
420688
public static String readResource(String resourceName, String charset) {
        InputStream is = Util.class.getResourceAsStream(resourceName);
        try {
            return read(is, charset);
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            closeQuietly(is);
        }
    }
1290860
public List<ResourceFileSource> getSources() {
		List<ResourceFileSource> sources = new ArrayList<ResourceFileSource>();
		sources.add(this);
		return sources;
	}
729967
@Override
	public Reader getResourceAsReader(String resourceName) throws IOException {

		try {
			return rsHandler.getResource(null, resourceName, true);
		} catch (ResourceNotFoundException e) {
			throw new IOException("The resource '" + resourceName + "' was not found.");
		}
	}
77643
@Override
    Resource getResource(final String relativePath) {
        return allResourcePaths.contains(relativePath) ? newResource(relativePath) : null;
    }
292531
@Override
    public Object createResource(ResourceInfo info) throws Exception {
        ComponentMetaData cData = ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor().getComponentMetaData();
        if (cData != null)
            applications.add(cData.getJ2EEName().getApplication());

        return cloudantSvc.createResource(
                                          (String) props.get("databaseName"),
                                          (Boolean) props.get("create"),
                                          info == null ? ResourceInfo.AUTH_APPLICATION : info.getAuth(),
                                          info == null ? null : info.getLoginPropertyList());
    }
1369101
public void loadResourceInfo(final String resourcePath) {

        CmsRpcAction<CmsResourceInfoBean> action = new CmsRpcAction<CmsResourceInfoBean>() {

            /**
             * @see org.opencms.gwt.client.rpc.CmsRpcAction#execute()
             */
            @Override
            public void execute() {

                getService().getResourceInfo(resourcePath, getLocale(), this);
            }

            /**
             * @see org.opencms.gwt.client.rpc.CmsRpcAction#onResponse(java.lang.Object)
             */
            @Override
            protected void onResponse(CmsResourceInfoBean result) {

                showData(result);
            }
        };
        action.execute();
    }
439484
public String getResourceType() {
        if (resourceType == null) {
            resourceType = "";
            String type = resource.getResourceType();
            if (StringUtils.isBlank(type) || getPrimaryType().equals(type)) {
                Resource contentResource = getContentResource();
                if (contentResource != null) {
                    type = contentResource.getResourceType();
                    if (StringUtils.isNotBlank(type)) {
                        ResourceHandle handle = ResourceHandle.use(contentResource);
                        if (type.equals(handle.getPrimaryType())) {
                            type = null;
                        }
                    }
                }
            }
            if (StringUtils.isNotBlank(type)) {
                // check for a real existing resource type
                if (!Resource.RESOURCE_TYPE_NON_EXISTING.equals(type)) {
                    resourceType = type;
                }
            }
        }
        return resourceType;
    }
825436
String getResourceName() {
        if (!resourceNameKnown) {
            // The resource name of a classfile can only be determined by
            // reading
            // the file and parsing the constant pool.
            // If we can't do this for some reason, then we just
            // make the resource name equal to the filename.

            try {
                resourceName = getClassDescriptor().toResourceName();
            } catch (Exception e) {
                resourceName = fileName;
            }

            resourceNameKnown = true;
        }
        return resourceName;
    }
695316
public static String getPathForResource(final String resourcePath) {
        URL path = ResourceUtil.class.getResource(resourcePath);
        if (path == null) {
            path = ResourceUtil.class.getResource("/");
            File tmpFile = new File(path.getPath(), resourcePath);
            return tmpFile.getPath();
        }

        return path.getPath();
    }
379330
public Resource getResource(String name, String encoding) throws IOException {
        return getResource(name, null, encoding);
    }
217060
public static Resource getResource(String location) {
        Resource resource = resolver.getResource(location);
        return resource.exists() ? resource : null;
    }
937034
private static void parseRessource(ArrayList<Shape> shapes,
                                       HashMap<String, JSONObject> flatJSON,
                                       String resourceId,
                                       Boolean keepGlossaryLink)
            throws JSONException {
        JSONObject modelJSON = flatJSON.get(resourceId);
        Shape current = getShapeWithId(modelJSON.getString("resourceId"),
                                       shapes);

        parseStencil(modelJSON,
                     current);

        parseProperties(modelJSON,
                        current,
                        keepGlossaryLink);
        parseOutgoings(shapes,
                       modelJSON,
                       current);
        parseChildShapes(shapes,
                         modelJSON,
                         current);
        parseDockers(modelJSON,
                     current);
        parseBounds(modelJSON,
                    current);
        parseTarget(shapes,
                    modelJSON,
                    current);
    }
1365232
public String getLocalizedResource(String namespace, String resourceId) throws Exception {
        String resourceValue = "";

        Class r = Class.forName(namespace + "$string");
        Field f = r.getField(resourceId);
        resourceValue = getCurrentActivity().getResources().getString(f.getInt(f));

        return resourceValue;
    }
1014637
@Override
	public Set<String> getResourceNames(String path) {

		Set<String> resources = null;

		URL resourceURL = null;

		try {
			resourceURL = ClassLoaderResourceUtils.getResourceURL(getCompletePath(path), this);
			if (resourceURL.toString().startsWith(JAR_URL_PREFIX)) {
				resources = getResourceNamesFromJar(path, resourceURL);
			} else if (resourceURL.toString().startsWith(FILE_URL_PREFIX)) {

				String dirPath = resourceURL.getFile();
				File dir = new File(dirPath);
				resources = FileUtils.getResourceNames(dir);
			}
		} catch (ResourceNotFoundException e) {

			if (LOGGER.isDebugEnabled()) {
				LOGGER.debug("Unable to find resources name for path '" + path + "'", e);
			}
			resources = Collections.emptySet();
		}

		return resources;
	}