Skip to content
Permalink
Browse files

Just some code beautifying

  • Loading branch information...
atooni committed Feb 14, 2019
1 parent 91ca808 commit 07783070ab5bbe55117298c2fe58fa693daaf228
@@ -40,10 +40,11 @@ class FilePollActor(
private[this] def locked() : Boolean = cfg.lock match {
case None => false
case Some(l) =>
val f = if (l.startsWith("./"))
val f = if (l.startsWith("./")) {
new File(cfg.sourceDir, l.substring(2))
else
} else {
new File(l)
}

if (f.exists()) {
log.info(s"Directory for [${cfg.id}] is locked with file [${f.getAbsolutePath()}]")
@@ -66,7 +67,6 @@ class FilePollActor(
} else if (locked()) {
List.empty
} else {

srcDir.listFiles(new FilenameFilter {
override def accept(dir: File, name: String): Boolean = {
if (cfg.pattern.isEmpty || cfg.pattern.forall(p => name.matches(p))) {
@@ -33,10 +33,11 @@ class FilePollSpec extends LoggingFreeSpec with Matchers {
lock = Some(lockfile)
)

val lockFile = if (lockfile.startsWith("./"))
val lockFile = if (lockfile.startsWith("./")) {
new File(cfg.sourceDir, lockfile.substring(2))
else
} else {
new File(lockfile)
}

genFile(lockFile)

0 comments on commit 0778307

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