io.viper.common.StaticFileContentInfoProviderFactory.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of io.viper.core Show documentation
Show all versions of io.viper.core Show documentation
A netty based HTTP server and toolkit.
The newest version!
package io.viper.common
import io.viper.core.server.file.{FileContentInfoProvider, InsertOnlyFileContentInfoCache, StaticFileContentInfoProvider}
object StaticFileContentInfoProviderFactory
{
var _enableCache = true
def enableCache(flag: Boolean) {
_enableCache = flag
}
def create(clazz: Class[_], resourcePath: String): FileContentInfoProvider = {
val rawFileProvider = StaticFileContentInfoProvider.create(clazz, resourcePath)
if (_enableCache) new InsertOnlyFileContentInfoCache(rawFileProvider) else rawFileProvider
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy