// Create first file
try {
output = createClassFile(sortedList, 0);
input = new LineNumberReader(
new InputStreamReader(
new SkipCRInputStream(new FileInputStream(javaFile))));
_currentChar = input.read();
_currentColumn = 1;
} catch (Exception e) {
e.printStackTrace();
System.out.println("1: Could not open file:"
+ javaFile.getAbsolutePath());
System.out.println(" or html file.");
System.exit(1);
return;
}
for (int i = 0; i < sortedList.length; i++) {
t = (HTMLTag) sortedList[i];
if (debug) {
System.out.println("\nTag Text=\"" + t.getText() + "\"");
System.out.println("Length=" + t.getOrigLength());
System.out.println("Line,col=" + t.getLine() + ","
+ t.getStartColumn());
}
// Check for new java file encountered.
// Close previous files and open new ones.
String currentFile = javaFile.toString();
String newFile = t.getFile().toString();
if (debug) {
System.out.println("cur file=|" + currentFile + "|");
}
if (debug) {
System.out.println("new file=|" + newFile + "|");
}
if (!newFile.equals(currentFile)) {
try {
// Write out rest of previous file
finishFile(input, output);
// Open new file
javaFile = t.getFile();
input = new LineNumberReader(
new InputStreamReader(
new SkipCRInputStream(
new FileInputStream(javaFile))));
output = createClassFile(sortedList, i);
_currentColumn = 1;
_currentChar = input.read();