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

com.seanshubin.detangler.scanner.FileScannerImpl.scala Maven / Gradle / Ivy

There is a newer version: 0.9.4
Show newest version
package com.seanshubin.detangler.scanner

import java.nio.file.Path

import com.seanshubin.detangler.timer.Timer

class FileScannerImpl(zipScanner: ZipScanner,
                      classScanner: ClassScanner,
                      timer: Timer) extends FileScanner {
  override def loadBytes(jarOrClass: Path): Iterable[Seq[Byte]] = {
    if (FileTypes.isCompressed(jarOrClass.toString)) {
      timer.measureTime(s"scan compressed file $jarOrClass") {
        zipScanner.loadBytes(jarOrClass)
      }
    } else {
      classScanner.loadBytes(jarOrClass)
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy