All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.swoval.files.NoCache.scala Maven / Gradle / Ivy

The newest version!
package com.swoval.files

class NoCache(options: Options) extends FileCache {
  private[this] val executor: Executor =
    platform.makeExecutor("com.swoval.files.NoCache.executor-thread")
  private[this] val watcher = options.toWatcher(callback, executor)
  override def close(): Unit = {
    watcher.foreach(_.close())
    executor.close()
  }
  override def list(path: Path, recursive: Boolean, filter: PathFilter): Seq[Path] = {
    watcher.foreach(_.register(path, recursive))
    if (path.exists) {
      path.list(recursive, filter)
    } else {
      Seq.empty
    }
  }
  override def register(path: Path, recursive: Boolean): Option[Directory] = None
}
object NoCache extends NoCache(Options.default)




© 2015 - 2025 Weber Informatics LLC | Privacy Policy