本文整理汇总了Java中org.codehaus.plexus.resource.loader.ResourceNotFoundException类的典型用法代码示例。如果您正苦于以下问题:Java ResourceNotFoundException类的具体用法?Java ResourceNotFoundException怎么用?Java ResourceNotFoundException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ResourceNotFoundException类属于org.codehaus.plexus.resource.loader包,在下文中一共展示了ResourceNotFoundException类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getResource
import org.codehaus.plexus.resource.loader.ResourceNotFoundException; //导入依赖的package包/类
protected URL getResource( String pResource )
throws MojoFailureException
{
try
{
return getLocator().getResource( pResource ).getURL();
}
catch ( ResourceNotFoundException exception )
{
throw new MojoFailureException( "Could not find stylesheet: " + pResource );
}
catch ( IOException e )
{
throw new MojoFailureException( "Error while locating resource: " + pResource );
}
}
示例2: prepareForKeys
import org.codehaus.plexus.resource.loader.ResourceNotFoundException; //导入依赖的package包/类
/**
* Prepare cache and keys map.
*
* @throws MojoFailureException
* @throws MojoExecutionException
*/
private void prepareForKeys() throws MojoFailureException, MojoExecutionException {
initCache();
try {
keysMap.load(keysMapLocation);
} catch (ResourceNotFoundException | IOException e) {
throw new MojoExecutionException("load keys map", e);
}
}
示例3: load
import org.codehaus.plexus.resource.loader.ResourceNotFoundException; //导入依赖的package包/类
public void load(String locale) throws ResourceNotFoundException, IOException {
if (!Strings.isNullOrEmpty(locale) && !Strings.isNullOrEmpty(locale.trim())) {
final Map<String, String> propertyMap;
try (final InputStream inputStream = resourceManager.getResourceAsInputStream(locale)) {
propertyMap = loadKeysMap(inputStream);
}
processKeysMap(propertyMap);
}
}