Class SyncStaticContentHeadersFooters

java.lang.Object
org.epics.archiverappliance.mgmt.bpl.SyncStaticContentHeadersFooters

public class SyncStaticContentHeadersFooters extends Object
Small utility to sync the headers and footers from index.html to the other html files. Typically called from the build script on demand. This can also be used to do some simple site specific customization at startup time.
Usage: java SyncStaticContentHeadersFooters <IndexFileName> <Locations of static html files>
Author:
mshankar
  • Constructor Details

    • SyncStaticContentHeadersFooters

      public SyncStaticContentHeadersFooters()
  • Method Details

    • main

      public static void main(String[] args) throws IOException
      Throws:
      IOException
    • breakFileIntoChunks

      public static LinkedList<SyncStaticContentHeadersFooters.TextChunk> breakFileIntoChunks(File file) throws IOException
      Break down a file into a list of text chunks each of which is identified by the text string in the @begin(...) if any... Regular text chunks come as REGULAR_TEXT chunks
      Parameters:
      file - File
      Returns:
      LinkedList TextChunk
      Throws:
      IOException -  
    • breakFileIntoChunks

      public static LinkedList<SyncStaticContentHeadersFooters.TextChunk> breakFileIntoChunks(InputStream is, String startOfChunkIndicator, String endOfChunkIndicator) throws IOException
      Break down a file into a list of text chunks each of which is identified by the text string in the @begin(...) if any... Regular text chunks come as REGULAR_TEXT chunks This method closes the inputstream is after it is done.
      Parameters:
      is - InputStream
      startOfChunkIndicator -  
      endOfChunkIndicator -  
      Returns:
      LinkedList TextChunk
      Throws:
      IOException -  
    • templateReplaceChunksHTML

      public static ByteArrayInputStream templateReplaceChunksHTML(InputStream is, HashMap<String,String> templateReplacements) throws IOException
      Breaks the HTML inputstream is into chunks and replaces the templates with the content in templateReplacements. The inputstream is is closed after this operation.
      Parameters:
      is - InputStream
      templateReplacements - HashMap
      Returns:
      ByteArrayInputStream  
      Throws:
      IOException -  
    • templateReplaceChunksJavascript

      public static ByteArrayInputStream templateReplaceChunksJavascript(InputStream is, HashMap<String,String> templateReplacements) throws IOException
      Breaks the Javascript inputstream is into chunks and replaces the templates with the content in templateReplacements. The inputstream is is closed after this operation.
      Parameters:
      is - InputStream
      templateReplacements - HashMap
      Returns:
      ByteArrayInputStream  
      Throws:
      IOException -