Package com.sun.identity.shared.xml
Class Resource
- java.lang.Object
-
- com.sun.identity.shared.xml.Resource
-
public final class Resource extends Object
This utility is used to read any resource such as dtd file or xml file from a jar file or from a file system we use java class delegation to the class loader to achieve this
-
-
Constructor Summary
Constructors Constructor Description Resource()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stringread(Reader aReader)Returns resource string from a reader.static Stringread(String fileName)Returns resource string from a file.static Stringread(String fileName, Class cl)Reads the resource from a class loader.static booleansave(String aFileName, String aContent)Returnstrueif a string is successfully written to a file.
-
-
-
Method Detail
-
read
public static String read(String fileName, Class cl)
Reads the resource from a class loader.- Parameters:
fileName- Resource to be read.cl- Class which delegates the classloader functionality.- Returns:
- resource value.
-
read
public static String read(Reader aReader)
Returns resource string from a reader.- Parameters:
aReader- Reader object.- Returns:
- resource string from a reader.
-
read
public static String read(String fileName)
Returns resource string from a file.- Parameters:
fileName- File name. Returns resource string from file.
-
-