
io.dropwizard.bundles.webjars.AssetWeigher Maven / Gradle / Ivy
package io.dropwizard.bundles.webjars;
import com.google.common.cache.Weigher;
/**
* Weigh an asset according to the number of bytes it contains.
*/
class AssetWeigher implements Weigher {
@Override
public int weigh(AssetId key, Asset asset) {
// return file size in bytes
return (asset.bytes != null) ? asset.bytes.length : 0;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy