-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#19 Give the report service access to the graphical asset service
- Loading branch information
1 parent
7797d6f
commit 548989c
Showing
9 changed files
with
52 additions
and
5 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
7 changes: 7 additions & 0 deletions
7
acropolis-report/src/main/kotlin/org/ephyra/acropolis/report/api/IImageSource.kt
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,7 @@ | ||
package org.ephyra.acropolis.report.api | ||
|
||
import java.io.InputStream | ||
|
||
interface IImageSource { | ||
fun get(resourceName: String): InputStream | ||
} |
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
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
21 changes: 21 additions & 0 deletions
21
...is-service/src/main/kotlin/org/ephyra/acropolis/service/impl/GraphicalAssetImageSource.kt
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,21 @@ | ||
package org.ephyra.acropolis.service.impl | ||
|
||
import org.ephyra.acropolis.report.api.IImageSource | ||
import org.ephyra.acropolis.service.api.IGraphicalAssetService | ||
import org.springframework.beans.factory.annotation.Autowired | ||
import org.springframework.stereotype.Component | ||
import java.io.ByteArrayInputStream | ||
import java.io.InputStream | ||
import java.lang.IllegalStateException | ||
|
||
@Component | ||
class GraphicalAssetImageSource : IImageSource { | ||
@Autowired | ||
private lateinit var graphicalAssetService: IGraphicalAssetService | ||
|
||
override fun get(resourceName: String): InputStream { | ||
val asset = graphicalAssetService.find(resourceName) | ||
?: throw IllegalStateException("Missing resource [$resourceName]") | ||
return ByteArrayInputStream(asset.source) | ||
} | ||
} |
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