/** * Unregister a stream receiver resource. * * @param resource * stream receiver resource to unregister */ public void unregisterResource(StreamReceiver resource) { res.remove(getURI(resource)); }
/** * Gets the URI for the given {@code resource}. * <p> * The URI won't be handled (and won't work) if {@code resource} is not * registered in the session. * * @see #registerResource(AbstractStreamResource) * * @param resource * stream resource * @return resource URI */ public static URI getURI(AbstractStreamResource resource) { return getURI(resource.getName(), resource.getId()); }
/** * Sets the given attribute to the given {@link StreamResource} value. * * @param attribute * the attribute name * @param resource * the value */ public void setResource(String attribute, AbstractStreamResource resource) { set(attribute, StreamResourceRegistry.getURI(resource).toASCIIString()); if (getNode().isAttached()) { registerResource(attribute, resource); } else { deferRegistration(attribute, resource); } }