Interface FileAndResourceDirectives

    • Method Detail

      • getFromFile

        scala.Function1<RequestContext,​scala.concurrent.Future<RouteResult>> getFromFile​(java.lang.String fileName,
                                                                                               ContentTypeResolver resolver)
        Completes GET requests with the content of the given file. If the file cannot be found or read the request is rejected.

        Parameters:
        fileName - (undocumented)
        resolver - (undocumented)
        Returns:
        (undocumented)
      • getFromFile

        scala.Function1<RequestContext,​scala.concurrent.Future<RouteResult>> getFromFile​(java.io.File file,
                                                                                               ContentTypeResolver resolver)
        Completes GET requests with the content of the given file. If the file cannot be found or read the request is rejected.

        Parameters:
        file - (undocumented)
        resolver - (undocumented)
        Returns:
        (undocumented)
      • getFromFile

        scala.Function1<RequestContext,​scala.concurrent.Future<RouteResult>> getFromFile​(java.io.File file,
                                                                                               ContentType contentType)
        Completes GET requests with the content of the given file. If the file cannot be found or read the request is rejected.

        Parameters:
        file - (undocumented)
        contentType - (undocumented)
        Returns:
        (undocumented)
      • conditionalFor

        Directive<scala.runtime.BoxedUnit> conditionalFor​(long length,
                                                          long lastModified)
      • getFromResource

        scala.Function1<RequestContext,​scala.concurrent.Future<RouteResult>> getFromResource​(java.lang.String resourceName,
                                                                                                   ContentTypeResolver resolver)
        Completes GET requests with the content of the given class-path resource. If the resource cannot be found or read the Route rejects the request.

        Parameters:
        resourceName - (undocumented)
        resolver - (undocumented)
        Returns:
        (undocumented)
      • getFromResource

        scala.Function1<RequestContext,​scala.concurrent.Future<RouteResult>> getFromResource​(java.lang.String resourceName,
                                                                                                   ContentType contentType,
                                                                                                   java.lang.ClassLoader classLoader)
        Completes GET requests with the content of the given resource. If the resource is a directory or cannot be found or read the Route rejects the request.

        Parameters:
        resourceName - (undocumented)
        contentType - (undocumented)
        classLoader - (undocumented)
        Returns:
        (undocumented)
      • getFromDirectory

        scala.Function1<RequestContext,​scala.concurrent.Future<RouteResult>> getFromDirectory​(java.lang.String directoryName,
                                                                                                    ContentTypeResolver resolver)
        Completes GET requests with the content of a file underneath the given directory. If the file cannot be read the Route rejects the request.

        Parameters:
        directoryName - (undocumented)
        resolver - (undocumented)
        Returns:
        (undocumented)
      • listDirectoryContents

        scala.Function1<RequestContext,​scala.concurrent.Future<RouteResult>> listDirectoryContents​(scala.collection.immutable.Seq<java.lang.String> directories,
                                                                                                         FileAndResourceDirectives.DirectoryRenderer renderer)
        Completes GET requests with a unified listing of the contents of all given directories. The actual rendering of the directory contents is performed by the in-scope Marshaller[DirectoryListing].

        Parameters:
        directories - (undocumented)
        renderer - (undocumented)
        Returns:
        (undocumented)
      • getFromBrowseableDirectories

        scala.Function1<RequestContext,​scala.concurrent.Future<RouteResult>> getFromBrowseableDirectories​(scala.collection.immutable.Seq<java.lang.String> directories,
                                                                                                                FileAndResourceDirectives.DirectoryRenderer renderer,
                                                                                                                ContentTypeResolver resolver)
        Serves the content of the given directories as a file system browser, i.e. files are sent and directories served as browseable listings.

        Parameters:
        directories - (undocumented)
        renderer - (undocumented)
        resolver - (undocumented)
        Returns:
        (undocumented)
      • getFromResourceDirectory

        scala.Function1<RequestContext,​scala.concurrent.Future<RouteResult>> getFromResourceDirectory​(java.lang.String directoryName,
                                                                                                            java.lang.ClassLoader classLoader,
                                                                                                            ContentTypeResolver resolver)
        Same as "getFromDirectory" except that the file is not fetched from the file system but rather from a "resource directory". If the requested resource is itself a directory or cannot be found or read the Route rejects the request.

        Parameters:
        directoryName - (undocumented)
        classLoader - (undocumented)
        resolver - (undocumented)
        Returns:
        (undocumented)
      • _defaultClassLoader

        java.lang.ClassLoader _defaultClassLoader()