Class StaticFileHandler

java.lang.Object
io.fluxzero.sdk.web.StaticFileHandler
All Implemented Interfaces:
Closeable, AutoCloseable

public class StaticFileHandler extends Object implements Closeable
Serves static resources with streamed bodies and content-based validators for the selected representation. ETags are SHA-256 digests. Digests of immutable resources in JAR files opened by this handler are reused for that open archive's lifetime, separately for each encoded representation. Other sources, including filesystem overrides, exploded classpaths and externally resolved nested JARs, are read with bounded memory on every request. This detects changed files even when size and modification time are preserved. Keep archives immutable while open and other files stable until pending responses finish; prefer immutable, versioned asset paths.
  • Field Details

  • Constructor Details

    • StaticFileHandler

      public StaticFileHandler()
    • StaticFileHandler

      public StaticFileHandler(String webRoot)
    • StaticFileHandler

      public StaticFileHandler(String webRoot, String resourceBasePath)
    • StaticFileHandler

      public StaticFileHandler(String webRoot, String resourceBasePath, @Nullable String fallbackFile)
    • StaticFileHandler

      public StaticFileHandler(String webRoot, String resourceBasePath, @Nullable String fallbackFile, Set<String> immutableCandidateExtensions)
    • StaticFileHandler

      public StaticFileHandler(String webRoot, String resourceBasePath, @Nullable String fallbackFile, Set<String> ignorePaths, Set<String> immutableCandidateExtensions, long maxAgeSeconds)
    • StaticFileHandler

      public StaticFileHandler(String webRoot, String resourceBasePath, @Nullable String fallbackFile, Set<String> ignorePaths, Set<String> immutableCandidateExtensions, long maxAgeSeconds, boolean cleanUrls)
    • StaticFileHandler

      public StaticFileHandler(@NonNull @NonNull String webRoot, @Nullable Path fsBaseDirectory, @Nullable URI resourceBaseUri, @Nullable String fallbackFile, Set<String> ignorePaths, Set<String> immutableCandidateExtensions, long maxAgeSeconds)
    • StaticFileHandler

      public StaticFileHandler(@NonNull @NonNull String webRoot, @Nullable Path fsBaseDirectory, @Nullable URI resourceBaseUri, @Nullable String fallbackFile, Set<String> ignorePaths, Set<String> immutableCandidateExtensions, long maxAgeSeconds, boolean cleanUrls)
  • Method Details