Skip to content
Permalink
Browse files

Fix file system actor and update Readme

  • Loading branch information...
joblo2213 committed May 22, 2019
1 parent 29a8eb2 commit 7e6c4dd9b32e376a08032e3bd234099a1eb51e5e
Showing with 9 additions and 3 deletions.
  1. +6 −0 README.md
  2. +3 −3 src/main/scala/org/codeoverflow/chatoverflow/connector/actor/FileSystemActor.scala
@@ -32,6 +32,12 @@ Please see the wiki to learn how to code new [platform sources](https://github.c

Chat Overflow releases are not yet available. ETA Q2 2019.

### Discord

The perfect place if you need help with the framework, found a bug or want to share your own plugin:

[![discord](https://discordapp.com/api/guilds/577412066994946060/widget.png?style=banner2)](https://discord.gg/p2HDsme)

### About Code Overflow

Code Overflow started as a coding-livestream project by three computer science students @ [KIT, Karlsruhe](http://www.kit.edu/) and is headed by [skate702](http://skate702.de).
@@ -36,9 +36,9 @@ class FileSystemActor extends Actor {
}
case LoadBinaryFile(pathInResources) =>
try {
sender ! Some(Files.readAllBytes(new File(s"$dataFilePath${fixPath(pathInResources)}").toPath))
sender ! Files.readAllBytes(new File(s"$dataFilePath${fixPath(pathInResources)}").toPath)
} catch {
case _: Exception => None
case _: Exception => Array[Byte]()
}
case SaveFile(pathInResources, content) =>
try {
@@ -65,7 +65,7 @@ class FileSystemActor extends Actor {
}

private def fixPath(path: String): String = {
val fixedPath = Paths.get(File.pathSeparator, path).normalize()
val fixedPath = Paths.get(File.separator, path).normalize()
fixedPath.toString
}
}

0 comments on commit 7e6c4dd

Please sign in to comment.
You can’t perform that action at this time.