Add basic support for Java 7 NIO file systems (#20293)

This commit is contained in:
Michał Kiędyś 2016-04-25 19:25:26 +10:00 committed by Konrad Malawski
parent 6d399a308e
commit b983f19c1f
23 changed files with 286 additions and 124 deletions

View file

@ -4,7 +4,7 @@
package docs.http.scaladsl.server.directives
import java.io.File
import java.nio.file.Paths
import akka.actor.ActorSystem
import akka.event.Logging
@ -190,7 +190,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
path("sample") {
complete {
// internally uses the configured fileIODispatcher:
val source = FileIO.fromFile(new File("example.json"))
val source = FileIO.fromPath(Paths.get("example.json"))
HttpResponse(entity = HttpEntity(ContentTypes.`application/json`, source))
}
}