object ZipStream
Provider of streams that take in zip entries and produces zipped data as output.
This offers a number of methods that will create Akka Streams stages that can be used to write zip archives. To write to your zip, you will send in a stream of ZipStream.Entry objects, which are an abstraction of a single entry in a zip archive.
The structure of a zip archive requires that a single entry is written to completion once
it is started, so you may wish to organize the incoming stream so that it does not emit an
Entry until its data is available.
For example, if the contents of a file are generated by a database query, you may wish to have
the completion of the query produce the Entry object rather than immediately producing an
entry that then executes a query to fetch the required data.
- Alphabetic
- By Inheritance
- ZipStream
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
final
class
Entry
extends Zippable
An entry to be written into the zip file.
An entry to be written into the zip file.
- Note
These are NOT serializable, as they contain a stream
Source.
-
case class
EntryMetadata
(name: String, creation: Option[Instant] = None, lastAccess: Option[Instant] = None, lastModified: Option[Instant] = None, comment: Option[String] = None, extra: Option[Array[Byte]] = None) extends Product with Serializable
The metadata associated with a single entry in a zip file.
- sealed trait EntryStorage extends AnyRef
- final class ExistingZip extends Zippable
-
sealed
trait
Zippable
extends AnyRef
A source of data that can be included in a stream that is constructing zipped data.
A source of data that can be included in a stream that is constructing zipped data. These provide a stream and thus they are not serializable.
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
val
defaultFileBuffer: Option[Int]
The default buffer size when writing zipped data to a file.
-
val
defaultFlowBuffer: Option[Int]
The default buffer size when outputting zipped data as a stream.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toFile(path: Path, existingFile: ExistingFile = ExistingFile.Fail, buffer: Option[Int] = defaultFileBuffer, level: Option[Int] = None)(implicit ec: ExecutionContext): Sink[Zippable, Future[IOResult]]
A zip compressor that takes in entries and writes them to a file.
A zip compressor that takes in entries and writes them to a file.
- path
the location of the file to be written.
- existingFile
what to do if there is already a file at the provided path.
- buffer
the size (in bytes) of an optional buffer that will hold the zipped data before it is written to the file. The OS probably offers output buffering, but this can potentially reduce the number of OS-level writes that need to be made.
- ec
the execution context to use for any callback operations. This context will not be used for any long-running or blocking operations.
-
def
toStream(buffer: Option[Int] = defaultFlowBuffer, level: Option[Int] = None)(implicit ec: ExecutionContext): Flow[Zippable, ByteString, Future[IOResult]]
A zip compressor that takes in entries and flows out bytes.
A zip compressor that takes in entries and flows out bytes.
- buffer
the size (in bytes) of an optional buffer that will hold the zipped data before it is converted into
ByteStringobjects. Using a buffer can substantially improve performance, as otherwise you may have many stream elements with just a few bytes in them.- ec
the execution context to use for any callback operations. This context will not be used for any long-running or blocking operations.
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- object DeflateEntry extends EntryStorage with Product with Serializable
- object EntryMetadata extends Serializable
- object EntryStorage
- object ExistingZip
- object StoreEntry extends EntryStorage with Product with Serializable