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

@ -3,7 +3,8 @@
*/
package akka.stream.impl.io
import java.io.{ File, InputStream }
import java.io.InputStream
import java.nio.file.Path
import akka.stream._
import akka.stream.ActorAttributes.Dispatcher
@ -17,9 +18,9 @@ import scala.concurrent.{ Future, Promise }
/**
* INTERNAL API
* Creates simple synchronous (Java 6 compatible) Source backed by the given file.
* Creates simple synchronous Source backed by the given file.
*/
private[akka] final class FileSource(f: File, chunkSize: Int, val attributes: Attributes, shape: SourceShape[ByteString])
private[akka] final class FileSource(f: Path, chunkSize: Int, val attributes: Attributes, shape: SourceShape[ByteString])
extends SourceModule[ByteString, Future[IOResult]](shape) {
require(chunkSize > 0, "chunkSize must be greater than 0")
override def create(context: MaterializationContext) = {