=htc, doc replace usages of deprecated methods of FileIO (#20928)
This commit is contained in:
parent
c81ea4f36b
commit
32810e1f1d
12 changed files with 34 additions and 26 deletions
|
|
@ -35,7 +35,7 @@ class FileUploadExamplesSpec extends RoutingSpec {
|
|||
// stream into a file as the chunks of it arrives and return a future
|
||||
// file to where it got stored
|
||||
val file = File.createTempFile("upload", "tmp")
|
||||
b.entity.dataBytes.runWith(FileIO.toFile(file)).map(_ =>
|
||||
b.entity.dataBytes.runWith(FileIO.toPath(file.toPath)).map(_ =>
|
||||
(b.name -> file))
|
||||
|
||||
case b: BodyPart =>
|
||||
|
|
|
|||
|
|
@ -138,8 +138,8 @@ IO Sources / Sinks materialize IOResult
|
|||
|
||||
Materialized values of the following sources and sinks:
|
||||
|
||||
* ``FileIO.fromFile``
|
||||
* ``FileIO.toFile``
|
||||
* ``FileIO.fromPath``
|
||||
* ``FileIO.toPath``
|
||||
* ``StreamConverters.fromInputStream``
|
||||
* ``StreamConverters.fromOutputStream``
|
||||
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ Akka Streams provide simple Sources and Sinks that can work with :class:`ByteStr
|
|||
on files.
|
||||
|
||||
|
||||
Streaming data from a file is as easy as creating a `FileIO.fromFile` given a target file, and an optional
|
||||
Streaming data from a file is as easy as creating a `FileIO.fromPath` given a target path, and an optional
|
||||
``chunkSize`` which determines the buffer size determined as one "element" in such stream:
|
||||
|
||||
.. includecode:: ../code/docs/stream/io/StreamFileDocSpec.scala#file-source
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ accepts strings as its input and when materialized it will create auxiliary
|
|||
information of type ``Future[IOResult]`` (when chaining operations on
|
||||
a :class:`Source` or :class:`Flow` the type of the auxiliary information—called
|
||||
the “materialized value”—is given by the leftmost starting point; since we want
|
||||
to retain what the ``FileIO.toFile`` sink has to offer, we need to say
|
||||
to retain what the ``FileIO.toPath`` sink has to offer, we need to say
|
||||
``Keep.right``).
|
||||
|
||||
We can use the new and shiny :class:`Sink` we just created by
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue