Class FaviconProvider
java.lang.Object
org.apache.juneau.rest.server.convention.FaviconProvider
Flavor-neutral favicon worker bean shared by the favicon
@Rest flavors.
Holds the capability state (the icon bytes + Cache-Control header value) and the serve
logic (build an HttpResource with Content-Type: image/x-icon + the cache header).
The FaviconMixin (mixin), FaviconResource (child), and FaviconServlet
(servlet) flavors are independent @Rest classes that each hold a FaviconProvider worker
and delegate to it — so the three deployment forms cannot drift, and no flavor is another
flavor's worker.
See Also:
- Since:
- 10.0.0
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefaultCache-Controlheader value:max-age=2592000, public(30 days). -
Constructor Summary
ConstructorsModifierConstructorDescriptionNo-arg constructor — loads the default Juneau-branded favicon from the classpath.protectedFaviconProvider(FaviconProvider.Builder builder) Builder constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic FaviconProvider.Buildercreate()Creates a new builder for configuring aFaviconProvider.serve()Serves the configured favicon bytes.
-
Field Details
-
DEFAULT_CACHE_CONTROL
DefaultCache-Controlheader value:max-age=2592000, public(30 days).- See Also:
-
-
Constructor Details
-
FaviconProvider
public FaviconProvider()No-arg constructor — loads the default Juneau-branded favicon from the classpath. -
FaviconProvider
Builder constructor.- Parameters:
builder- The builder. Must not benull .
-
-
Method Details
-
create
Creates a new builder for configuring aFaviconProvider.- Returns:
- A new builder.
-
serve
Serves the configured favicon bytes.- Returns:
- The favicon as an
HttpResourcewithContent-Type: image/x-iconand the configuredCache-Controlheader.
-