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

com.github.linyuzai.download.autoconfigure.DownloadConceptOkHttpAutoConfiguration Maven / Gradle / Ivy

There is a newer version: 2.1.0
Show newest version
package com.github.linyuzai.download.autoconfigure;

import com.github.linyuzai.download.okhttp.OkHttpSourceFactory;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * OkHttp的配置 / Configuration of OkHttp
 */
@Configuration
@AutoConfigureBefore(DownloadConceptAutoConfiguration.class)
@ConditionalOnClass(OkHttpSourceFactory.class)
public class DownloadConceptOkHttpAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean
    @ConditionalOnClass(name = "okhttp3.OkHttpClient")
    public OkHttpSourceFactory okHttpOriginalSourceFactory() {
        return new OkHttpSourceFactory();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy