Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Commit

Permalink
Fix file system actor and update Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
J0B10 committed May 22, 2019
1 parent 29a8eb2 commit 7e6c4dd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -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).
Expand Up @@ -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 {
Expand All @@ -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
}
}
Expand Down

0 comments on commit 7e6c4dd

Please sign in to comment.