Class XmlFileService

java.lang.Object
lt.viko.eif.jguscia.services.XmlFileService

public class XmlFileService extends Object
Service responsible for loading XML files from the application's resources. <p> Reads a resource file from the classpath and returns its contents as a UTF-8 string.
  • Constructor Details

    • XmlFileService

      public XmlFileService()
  • Method Details

    • readXmlFromResources

      public String readXmlFromResources(String resourceName) throws IOException
      Reads an XML file from the application resources.
      Parameters:
      resourceName - name or path of the resource file
      Returns:
      contents of the XML file as a string
      Throws:
      IllegalArgumentException - if the resource name is null or blank
      IOException - if the resource cannot be found or read