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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SyncStaticContentHeadersFooters.TextChunk
-
Constructor Summary
Constructors Constructor Description SyncStaticContentHeadersFooters()
-
Method Summary
Modifier and Type Method Description static LinkedList<SyncStaticContentHeadersFooters.TextChunk>
breakFileIntoChunks(File file)
Break down a file into a list of text chunks each of which is identified by the text string in the @begin(...) if any...static LinkedList<SyncStaticContentHeadersFooters.TextChunk>
breakFileIntoChunks(InputStream is, String startOfChunkIndicator, String endOfChunkIndicator)
Break down a file into a list of text chunks each of which is identified by the text string in the @begin(...) if any...static void
main(String[] args)
static ByteArrayInputStream
templateReplaceChunksHTML(InputStream is, HashMap<String,String> templateReplacements)
Breaks the HTML inputstream is into chunks and replaces the templates with the content in templateReplacements.static ByteArrayInputStream
templateReplaceChunksJavascript(InputStream is, HashMap<String,String> templateReplacements)
Breaks the Javascript inputstream is into chunks and replaces the templates with the content in templateReplacements.
-
-
-
Method Detail
-
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
- InputStreamstartOfChunkIndicator
-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
- InputStreamtemplateReplacements
- 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
- InputStreamtemplateReplacements
- HashMap- Returns:
- ByteArrayInputStream
- Throws:
IOException
-
-
-