Class BuildHMCScripts

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class BuildHMCScripts
    extends org.apache.tools.ant.Task
    Concatenates all files with file ending *.[filetype] of all extensions with hmc module located at hmc/web/webroot/ext/[extension]/[filetype] folder (directories will be processed before files and always in alphabetical order) to one large hmc.[filetype] file at hmc/web/webroot/[filetype] at hmc extension. For the hmc extension itself, the files has to be located at hmc/web/webroot/[filetype]/src.
    • Field Summary

      • Fields inherited from class org.apache.tools.ant.Task

        target, taskName, taskType, wrapper
      • Fields inherited from class org.apache.tools.ant.ProjectComponent

        description, location, project
    • Constructor Summary

      Constructors 
      Constructor Description
      BuildHMCScripts()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void execute()  
      protected java.lang.String readFromFile​(java.io.File file)
      read from file and put file content into a string
      void setFiletype​(java.lang.String type)
      Sets the file type to process (in general js or css).
      protected void writeToFile​(java.io.File file, java.lang.String string)
      write String to file
      • Methods inherited from class org.apache.tools.ant.Task

        bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
      • Methods inherited from class org.apache.tools.ant.ProjectComponent

        clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BuildHMCScripts

        public BuildHMCScripts()
    • Method Detail

      • setFiletype

        public void setFiletype​(java.lang.String type)
        Sets the file type to process (in general js or css).
        Parameters:
        type - type to process
      • execute

        public void execute()
                     throws org.apache.tools.ant.BuildException
        Overrides:
        execute in class org.apache.tools.ant.Task
        Throws:
        org.apache.tools.ant.BuildException
      • readFromFile

        protected java.lang.String readFromFile​(java.io.File file)
                                         throws java.io.IOException,
                                                java.io.FileNotFoundException
        read from file and put file content into a string
        Parameters:
        file - the file to read
        Returns:
        the file content
        Throws:
        java.io.IOException - by IO Error
        java.io.FileNotFoundException - throws if file not found
      • writeToFile

        protected void writeToFile​(java.io.File file,
                                   java.lang.String string)
                            throws java.io.IOException
        write String to file
        Parameters:
        file - the file
        string - the string
        Throws:
        java.io.IOException - IO Error