本文整理汇总了Java中org.springframework.core.io.FileSystemResourceLoader.setClassLoader方法的典型用法代码示例。如果您正苦于以下问题:Java FileSystemResourceLoader.setClassLoader方法的具体用法?Java FileSystemResourceLoader.setClassLoader怎么用?Java FileSystemResourceLoader.setClassLoader使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.core.io.FileSystemResourceLoader
的用法示例。
在下文中一共展示了FileSystemResourceLoader.setClassLoader方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testFileWithSpecialCharsInTheNameBeingResolved
import org.springframework.core.io.FileSystemResourceLoader; //导入方法依赖的package包/类
public void testFileWithSpecialCharsInTheNameBeingResolved() throws Exception {
String name = Thread.currentThread().getContextClassLoader().getResource( "test-file" ).toString();
FileSystemResourceLoader fileLoader = new FileSystemResourceLoader();
fileLoader.setClassLoader(getClass().getClassLoader());
Resource fileRes = fileLoader.getResource(name);
resource = new OsgiBundleResource(bundle, name);
testFileVsOsgiFileResolution(fileRes, resource);
}
示例2: testFileWithEmptyCharsInTheNameBeingResolved
import org.springframework.core.io.FileSystemResourceLoader; //导入方法依赖的package包/类
public void testFileWithEmptyCharsInTheNameBeingResolved() throws Exception {
String name = Thread.currentThread().getContextClassLoader().getResource( "test file" ).toString();
FileSystemResourceLoader fileLoader = new FileSystemResourceLoader();
fileLoader.setClassLoader(getClass().getClassLoader());
Resource fileRes = fileLoader.getResource(name);
resource = new OsgiBundleResource(bundle, name);
testFileVsOsgiFileResolution(fileRes, resource);
}
示例3: testFileWithNormalCharsInTheNameBeingResolved
import org.springframework.core.io.FileSystemResourceLoader; //导入方法依赖的package包/类
public void testFileWithNormalCharsInTheNameBeingResolved() throws Exception {
String name = Thread.currentThread().getContextClassLoader().getResource( "normal" ).toString();
FileSystemResourceLoader fileLoader = new FileSystemResourceLoader();
fileLoader.setClassLoader(getClass().getClassLoader());
Resource fileRes = fileLoader.getResource(name);
resource = new OsgiBundleResource(bundle, name);
testFileVsOsgiFileResolution(fileRes, resource);
}
示例4: testFileWithSpecialCharsInTheNameBeingResolved
import org.springframework.core.io.FileSystemResourceLoader; //导入方法依赖的package包/类
public void testFileWithSpecialCharsInTheNameBeingResolved() throws Exception {
String name = "file:./target/test-classes/test-file";
FileSystemResourceLoader fileLoader = new FileSystemResourceLoader();
fileLoader.setClassLoader(getClass().getClassLoader());
Resource fileRes = fileLoader.getResource(name);
resource = new OsgiBundleResource(bundle, name);
testFileVsOsgiFileResolution(fileRes, resource);
}
示例5: testFileWithEmptyCharsInTheNameBeingResolved
import org.springframework.core.io.FileSystemResourceLoader; //导入方法依赖的package包/类
public void testFileWithEmptyCharsInTheNameBeingResolved() throws Exception {
String name = "file:./target/test-classes/test file";
FileSystemResourceLoader fileLoader = new FileSystemResourceLoader();
fileLoader.setClassLoader(getClass().getClassLoader());
Resource fileRes = fileLoader.getResource(name);
resource = new OsgiBundleResource(bundle, name);
testFileVsOsgiFileResolution(fileRes, resource);
}
示例6: testFileWithNormalCharsInTheNameBeingResolved
import org.springframework.core.io.FileSystemResourceLoader; //导入方法依赖的package包/类
public void testFileWithNormalCharsInTheNameBeingResolved() throws Exception {
String name = "file:pom.xml";
FileSystemResourceLoader fileLoader = new FileSystemResourceLoader();
fileLoader.setClassLoader(getClass().getClassLoader());
Resource fileRes = fileLoader.getResource(name);
resource = new OsgiBundleResource(bundle, name);
testFileVsOsgiFileResolution(fileRes, resource);
}