本文整理匯總了Java中org.restlet.resource.ResourceException.getCause方法的典型用法代碼示例。如果您正苦於以下問題:Java ResourceException.getCause方法的具體用法?Java ResourceException.getCause怎麽用?Java ResourceException.getCause使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.restlet.resource.ResourceException
的用法示例。
在下文中一共展示了ResourceException.getCause方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getInfo
import org.restlet.resource.ResourceException; //導入方法依賴的package包/類
/**
* Delegates to the <code>handleGetInfo()</code> entry point in the
* executable.
*
* @param variant
* The variant of the response entity
* @return The optional result info
* @throws ResourceException
* In case of a handling error
*/
@Override
public RepresentationInfo getInfo( Variant variant ) throws ResourceException
{
DelegatedResourceConversationService conversationService = new DelegatedResourceConversationService( this, null, variant, attributes.getDefaultCharacterSet() );
if( CachingUtil.mayFetch( getRequest(), executable, getDispatchedSuffix() ) )
{
CacheEntry cacheEntry = cachingUtil.fetchCacheEntry( getDispatchedSuffix(), ProgramParser.NAME, true, conversationService );
if( cacheEntry != null )
return cacheEntry.getInfo();
}
try
{
Object r = enter( this.attributes.getEntryPointNameForGetInfo(), false, conversationService );
if( ( r == null ) || Status.CLIENT_ERROR_METHOD_NOT_ALLOWED.equals( conversationService.getStatus() ) )
{
conversationService.setStatus( Status.SUCCESS_OK );
return get( variant );
}
return getRepresentationInfo( r, conversationService );
}
catch( ResourceException x )
{
if( x.getCause() instanceof NoSuchMethodException )
return get( variant );
else
throw x;
}
}