buf.append("]\nON ");
String lastFilegroup = "";
for (int i = 0; i < dataFiles.length; i++)
{
DatabaseFile file = (DatabaseFile) dataFiles[i];
String thisFilegroup = file.getFilegroup();
if (!thisFilegroup.equals(lastFilegroup))
{
// if it's PRIMARY, just write it without the FILEGROUP prefix.
if (thisFilegroup.equals("PRIMARY")) buf.append("PRIMARY");
else
{
buf.append("FILEGROUP ");
buf.append(thisFilegroup);
}
buf.append("\n");
lastFilegroup = thisFilegroup;
}
buf.append("( NAME = ");
buf.append(file.getName());
buf.append(",\n\tFILENAME = '");
buf.append(file.getFilename());
buf.append("',\n\tSIZE = ");
buf.append(file.getSize());
if (!file.getMaxSize().equals("Unlimited"))
{
buf.append(",\n\tMAXSIZE = ");
buf.append(file.getMaxSize());
}
buf.append(",\n\tFILEGROWTH = ");
buf.append(file.getGrowth());
buf.append(" )");
if (i < dataFiles.length - 1) buf.append(",");
buf.append("\n");
}
buf.append("LOG ON\n");
for (int i = 0; i < logFiles.length; i++)
{
DatabaseFile file = (DatabaseFile) logFiles[i];
buf.append("( NAME = ");
buf.append(file.getName());
buf.append(",\n\tFILENAME = '");
buf.append(file.getFilename());
buf.append("',\n\tSIZE = ");
buf.append(file.getSize());
if (!file.getMaxSize().equals("Unlimited"))
{
buf.append(",\n\tMAXSIZE = ");
buf.append(file.getMaxSize());
}
buf.append(",\n\tFILEGROWTH = ");
buf.append(file.getGrowth());
buf.append(" )");
if (i < logFiles.length - 1) buf.append(",");
buf.append("\n");