Class EmbeddedResourceLoader
- java.lang.Object
-
- com.microsoft.semantickernel.util.EmbeddedResourceLoader
-
public class EmbeddedResourceLoader extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEmbeddedResourceLoader.ResourceLocation
-
Constructor Summary
Constructors Constructor Description EmbeddedResourceLoader()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringreadFile(String fileName, Class<?> clazz)Loads a file to a string from the classpath using getResourceAsStreamstatic StringreadFile(String fileName, Class<?> clazz, EmbeddedResourceLoader.ResourceLocation... locations)Loads a file to a string from the classpath, classpath root or filesystem
-
-
-
Method Detail
-
readFile
public static String readFile(String fileName, Class<?> clazz) throws FileNotFoundException
Loads a file to a string from the classpath using getResourceAsStream- Parameters:
fileName- Filename to read- Returns:
- File content
- Throws:
FileNotFoundException- Error in case the file doesn't exist
-
readFile
public static String readFile(String fileName, Class<?> clazz, EmbeddedResourceLoader.ResourceLocation... locations) throws FileNotFoundException
Loads a file to a string from the classpath, classpath root or filesystem- Parameters:
fileName- Filename to read- Returns:
- File content
- Throws:
FileNotFoundException- Error in case the file doesn't exist
-
-