Class FileAndResourceDirectives.ResourceFile$

java.lang.Object
org.apache.pekko.http.scaladsl.server.directives.FileAndResourceDirectives.ResourceFile$
All Implemented Interfaces:
Serializable
Enclosing interface:
FileAndResourceDirectives

public static class FileAndResourceDirectives.ResourceFile$ extends Object implements Serializable
See Also:
  • Field Details

  • Constructor Details

    • ResourceFile$

      public ResourceFile$()
  • Method Details

    • apply

      public scala.Option<FileAndResourceDirectives.ResourceFile> apply(URL url)
      Probes the resource without keeping any handle open: for a resource inside a jar file the jar is opened, read and closed again, as this overload always did before the jar file cache became configurable. Use the two-argument overload to let the JDK's jar file cache keep the jar open across requests.
      Parameters:
      url - (undocumented)
      Returns:
      (undocumented)
    • apply

      public scala.Option<FileAndResourceDirectives.ResourceFile> apply(URL url, boolean useJarFileCache)
      Parameters:
      useJarFileCache - whether the JDK's jar file cache may be used for resources inside a jar file, see the pekko.http.routing.use-jar-file-cache setting
      url - (undocumented)
      Returns:
      (undocumented)
      Since:
      2.0.0
    • openConnection

      public URLConnection openConnection(URL url, boolean useJarFileCache)
      The one place that decides how a connection relates to the JDK's caches: with the jar file cache disabled the connection must own its jar file, with it enabled the JVM-wide default is left untouched, so that an application-wide URLConnection.setDefaultUseCaches(false) keeps its effect.
      Parameters:
      url - (undocumented)
      useJarFileCache - (undocumented)
      Returns:
      (undocumented)