package com.javahonk.di.bean;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;

public class SpringResourceInjection {

    @Autowired
    private ResourceLoader resourceLoader;

    public Resource loadDynamicResource() {
	boolean loadFirstFile = true;
	if (loadFirstFile) {
	    return resourceLoader
		    .getResource("spring/ResourceTestFile.txt");
	} else {
	    return resourceLoader
		    .getResource("spring/ResourceTestFile2.txt");
	}
    }
}
