public Resource create( final ResourceManager caller, final ResourceData data, final ResourceKey context ) throws ResourceCreationException, ResourceLoadingException { throw new ContentNotRecognizedException( "Reject GIF as drawable" ); } }
public Resource create( final ResourceManager caller, final ResourceData data, final ResourceKey context ) throws ResourceLoadingException, ResourceCreationException { throw new ContentNotRecognizedException(); } }
public Resource create( final ResourceManager caller, final ResourceData data, final ResourceKey context ) throws ResourceLoadingException, ResourceCreationException { throw new ContentNotRecognizedException(); } }
throw new ContentNotRecognizedException( "No valid handler for the given content." );
throw exception; throw new ContentNotRecognizedException( "None of the selected factories was able to handle the given data: " + data.getKey() );
public Resource create( final ResourceManager manager, ResourceData data, final ResourceKey context ) throws ResourceCreationException, ResourceLoadingException { if ( data instanceof CachingResourceBundleData ) { // todo: Friggin' cheap hack final CachingResourceBundleData cachingResourceBundleData = (CachingResourceBundleData) data; data = cachingResourceBundleData.getBackend(); } if ( data instanceof RepositoryResourceBundleData == false ) { data = manager.loadResourceBundle( data.getKey() ); if ( data instanceof CachingResourceBundleData ) { // todo: Friggin' cheap hack 2 final CachingResourceBundleData cachingResourceBundleData = (CachingResourceBundleData) data; data = cachingResourceBundleData.getBackend(); } } if ( data instanceof RepositoryResourceBundleData == false ) { throw new ContentNotRecognizedException( "No valid handler for the given content." ); } final RepositoryResourceBundleData bdata = (RepositoryResourceBundleData) data; final Repository repository = bdata.getRepository(); try { final StaticDocumentBundle bundle = new StaticDocumentBundle( repository, manager, bdata.getBundleKey() ); return new SimpleResource( data.getKey(), bundle, getFactoryType(), data.getVersion( manager ) ); } catch ( ResourceException e ) { throw new ResourceCreationException( "Unable to interpret document-bundle", e ); } }