Class SyncStaticContentHeadersFooters
java.lang.Object
org.epics.archiverappliance.mgmt.bpl.SyncStaticContentHeadersFooters
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbreakFileIntoChunks(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...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 voidstatic ByteArrayInputStreamtemplateReplaceChunksHTML(InputStream is, HashMap<String, String> templateReplacements) Breaks the HTML inputstream is into chunks and replaces the templates with the content in templateReplacements.static ByteArrayInputStreamtemplateReplaceChunksJavascript(InputStream is, HashMap<String, String> templateReplacements) Breaks the Javascript inputstream is into chunks and replaces the templates with the content in templateReplacements.
-
Constructor Details
-
SyncStaticContentHeadersFooters
public SyncStaticContentHeadersFooters()
-
-
Method Details
-
main
- 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 IOExceptionBreaks 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 IOExceptionBreaks 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-
-