-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove Tar archiving
- Loading branch information
Showing
18 changed files
with
142 additions
and
357 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 0 additions & 94 deletions
94
...ve/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/model/ArchiveFormat.scala
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...gins/archive/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/model/Zip.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package ch.epfl.bluebrain.nexus.delta.plugins.archive.model | ||
|
||
import akka.NotUsed | ||
import akka.http.scaladsl.model.{ContentType, HttpRequest, MediaTypes} | ||
import akka.stream.alpakka.file.scaladsl.Archive | ||
import akka.stream.alpakka.file.ArchiveMetadata | ||
import akka.stream.scaladsl.{Flow, Source} | ||
import akka.util.ByteString | ||
import ch.epfl.bluebrain.nexus.delta.sdk.utils.HeadersUtils | ||
|
||
/** | ||
* Zip archive format | ||
* | ||
* @see | ||
* https://en.wikipedia.org/wiki/ZIP_(file_format)#Limits for the limitations | ||
*/ | ||
object Zip { | ||
type WriteFlow[Metadata] = Flow[(Metadata, Source[ByteString, _]), ByteString, NotUsed] | ||
|
||
lazy val contentType: ContentType = MediaTypes.`application/zip` | ||
|
||
lazy val writeFlow: WriteFlow[ArchiveMetadata] = Archive.zip() | ||
|
||
lazy val ordering: Ordering[ArchiveMetadata] = Ordering.by(md => md.filePath) | ||
|
||
def metadata(filename: String): ArchiveMetadata = ArchiveMetadata.create(filename) | ||
|
||
def checkHeader(req: HttpRequest): Boolean = HeadersUtils.matches(req.headers, Zip.contentType.mediaType) | ||
} |
Oops, something went wrong.