Search in sources :

Example 6 with StreamRegistration

use of com.vaadin.flow.server.StreamRegistration in project flow by vaadin.

the class ElementAttributeMap method unsetResource.

private void unsetResource(String attribute) {
    ensureResourceRegistrations();
    StreamRegistration registration = resourceRegistrations.get(attribute);
    Optional<AbstractStreamResource> resource = Optional.empty();
    if (registration != null) {
        resource = Optional.ofNullable(registration.getResource());
    }
    unregisterResource(attribute);
    resource.ifPresent(res -> deferRegistration(attribute, res));
}
Also used : StreamRegistration(com.vaadin.flow.server.StreamRegistration) AbstractStreamResource(com.vaadin.flow.server.AbstractStreamResource)

Aggregations

StreamRegistration (com.vaadin.flow.server.StreamRegistration)6 StreamResource (com.vaadin.flow.server.StreamResource)2 StreamResourceRegistry (com.vaadin.flow.server.StreamResourceRegistry)2 Registration (com.vaadin.flow.shared.Registration)2 Test (org.junit.Test)2 Element (com.vaadin.flow.dom.Element)1 AbstractStreamResource (com.vaadin.flow.server.AbstractStreamResource)1 Command (com.vaadin.flow.server.Command)1 URI (java.net.URI)1