当前位置: 首页>>代码示例>>Java>>正文


Java Resource.toString方法代码示例

本文整理汇总了Java中org.eclipse.jetty.util.resource.Resource.toString方法的典型用法代码示例。如果您正苦于以下问题:Java Resource.toString方法的具体用法?Java Resource.toString怎么用?Java Resource.toString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jetty.util.resource.Resource的用法示例。


在下文中一共展示了Resource.toString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addFolderResource

import org.eclipse.jetty.util.resource.Resource; //导入方法依赖的package包/类
protected void addFolderResource(final WebAppContext context) throws IOException {
	for (Resource resource : context.getMetaData().getWebInfJars()) {
		String url = resource.toString();
		if (!isClassesDir(url)) {
			continue;
		}
		{
			Resource fragmentResource = resource.getResource("META-INF/web-fragment.xml");
			if (fragmentResource.exists()) {
				// addResource(context, METAINF_FRAGMENTS, resource);
			}
		}

		this.addTldResource(context, resource, "META-INF/fnx.tld");
		this.addTldResource(context, resource, "META-INF/dw.tld");
	}
}
 
开发者ID:tanhaichao,项目名称:leopard,代码行数:18,代码来源:EmbedMetaInfConfiguration.java

示例2: addJars

import org.eclipse.jetty.util.resource.Resource; //导入方法依赖的package包/类
/**
 * Add elements to the class path for the context from the jar and zip files found
 * in the specified resource.
 *
 * @param resource the resource that contains the jar and/or zip files.
 */
public void addJars(Resource resource) {
    if (resource.exists() && resource.isDirectory()) {
        String[] files = resource.list();
        for (int f = 0; files != null && f < files.length; f++) {
            try {
                Resource fn = resource.addPath(files[f]);
                String fnlc = fn.getName().toLowerCase(Locale.ENGLISH);
                // don't check if this is a directory, see Bug 353165
                if (isFileSupported(fnlc)) {
                    String name = fn.toString();
                    name = StringUtil.replace(name, ",", "%2C");
                    name = StringUtil.replace(name, ";", "%3B");
                    addClassPath(name);
                    List<Class<?>> classes = getClassesInJar(name);
                    for (Class<?> clazz : classes) {
                        knownClasses.put(clazz.getName(), clazz);
                    }
                }
            } catch (Exception ex) {
                LOG.error(String.format("Exception adding classpath entry from resource %s", resource.getName()), ex);
            }
        }
    }
}
 
开发者ID:nkasvosve,项目名称:beyondj,代码行数:31,代码来源:BeyondJWebAppClassLoader.java

示例3: setKeyStoreResource

import org.eclipse.jetty.util.resource.Resource; //导入方法依赖的package包/类
/** Set the key store resource.
 * @param resource the key store resource to set
 */
public void setKeyStoreResource(Resource resource)
{
    checkNotStarted();

    try
    {
        _keyStoreInputStream = resource.getInputStream();
    }
    catch (IOException e)
    {
         throw new InvalidParameterException("Unable to get resource "+
                 "input stream for resource "+resource.toString());
    }
}
 
开发者ID:itead,项目名称:IoTgo_Android_App,代码行数:18,代码来源:SslContextFactory.java

示例4: setTrustStoreResource

import org.eclipse.jetty.util.resource.Resource; //导入方法依赖的package包/类
/** Set the trust store resource.
 * @param resource the trust store resource to set
 */
public void setTrustStoreResource(Resource resource)
{
    checkNotStarted();

    try
    {
        _trustStoreInputStream = resource.getInputStream();
    }
    catch (IOException e)
    {
         throw new InvalidParameterException("Unable to get resource "+
                 "input stream for resource "+resource.toString());
    }
}
 
开发者ID:itead,项目名称:IoTgo_Android_App,代码行数:18,代码来源:SslContextFactory.java


注:本文中的org.eclipse.jetty.util.resource.Resource.toString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。