freemarker.ext.util
Class Splitter

java.lang.Object
  extended by freemarker.ext.util.Splitter

public class Splitter
extends java.lang.Object

Splits the given input stream or filename(s) into one or more output files. The splitter looks for lines containing the text:

 <!-- Filename: newfilename.blah -->
 

When such a line is encountered, a new file output stream is created, and the input is written to the named file until either the end of the input stream, or another such tag is encountered. The filename can be surrounded by optional double-quotes if leading or trailing whitespace is required in the filename.

Since:
1.8.2
Version:
$Id: Splitter.java 1101 2013-04-01 04:17:32Z run2000 $
Author:
Nicholas Cull

Method Summary
static void main(java.lang.String[] args)
          Split the given file or files into one or more output files.
static void splitInputStream(java.io.InputStream stream)
          Read an input stream and split it into one or more output files based on comment tokens in the input.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

splitInputStream

public static void splitInputStream(java.io.InputStream stream)
                             throws java.io.IOException
Read an input stream and split it into one or more output files based on comment tokens in the input.

Parameters:
stream - the input stream to be split into separate files
Throws:
java.io.IOException - there was a problem with either input or output streams

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Split the given file or files into one or more output files. If no argument is specified, stream from stdin.

Parameters:
args - the input filename, or none to specify standard input
Throws:
java.io.IOException