Guest User

Untitled

a guest
May 21st, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. val dummyData = ArrayList<DummyDataEntity>()
  2.  
  3. try {
  4. var line: String?
  5.  
  6. val res = ResourceUtils.getFile("classpath:db/data/dummydata.csv")
  7. fileReader = BufferedReader(FileReader(res.path))
  8.  
  9. // Read CSV header
  10. fileReader.readLine()
  11.  
  12. ... Processing the data ...
  13.  
  14. } catch (e: Exception) {
  15. e.printStackTrace()
  16. } finally {
  17. try {
  18. fileReader!!.close()
  19. } catch (e: Exception) {
  20. e.printStackTrace()
  21. }
  22.  
  23. return dummyData
  24. }
  25.  
  26. import com.palantir.gradle.docker.DockerExtension
  27. import io.spring.gradle.dependencymanagement.dsl.DependencyManagementExtension
  28. import org.gradle.tooling.model.GradleTask
  29. import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
  30. import org.springframework.boot.gradle.tasks.bundling.BootJar
  31.  
  32. buildscript {
  33. repositories {
  34. mavenCentral()
  35. }
  36.  
  37. dependencies {
  38. classpath(Libs.springBootGradlePlugin)
  39. classpath(Libs.kotlinGradlePlugin)
  40. classpath(Libs.kotlinAllOpen)
  41. classpath(Libs.gradleDocker)
  42. }
  43. }
  44.  
  45. plugins {
  46. // Apply the java-library plugin to add support for Java Library
  47. `java-library`
  48. }
  49.  
  50. apply {
  51. plugin("kotlin")
  52. plugin("kotlin-spring")
  53. plugin("org.springframework.boot")
  54. plugin("io.spring.dependency-management")
  55. plugin("com.palantir.docker")
  56. }
  57.  
  58. repositories {
  59. mavenCentral()
  60. }
  61.  
  62. dependencies {
  63. compile(Libs.kotlinReflect)
  64.  
  65. // Spring Boot
  66. compile(Libs.springBootStarterDataJpa)
  67. }
  68.  
  69. configure<DependencyManagementExtension> {
  70. imports {
  71. mavenBom(Libs.vaadinBom)
  72. }
  73. }
  74.  
  75. val bootJar: BootJar by tasks
  76. bootJar.baseName = "reporting-app-site"
  77. bootJar.version = "0.0.1"
  78.  
  79. configure<DockerExtension> {
  80. name = "brabantia/${bootJar.baseName}"
  81. files(bootJar.archivePath)
  82. buildArgs(mapOf("JAR_FILE" to bootJar.archiveName))
  83. dependsOn(tasks["build"])
  84. }
  85.  
  86. val compileKotlin: KotlinCompile by tasks
  87. compileKotlin.kotlinOptions.jvmTarget = "1.8"
  88.  
  89. java.io.FileNotFoundException: class path resource [db/data/dummydata.csv] cannot be resolved to absolute file path because it does not reside in the file system: jar:file:/app.jar!/BOOT-INF/classes!/db/data/dummydata.csv
Add Comment
Please, Sign In to add comment