本文整理汇总了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");
}
}
示例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);
}
}
}
}
示例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());
}
}
示例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());
}
}