throws PackException
{
System.out.println( "Writing resources to index file: " + out + ".index" );
final File file = new File( out + ".index" );
final Store store = Store.get( out, 1 );
final Index index = new Index( out, order, Index.KT_STRING, true, false );
index.setRecordStore( store );
OutputStream os = null;
try
{
if( !file.getParentFile().exists() )
{
file.getParentFile().mkdirs();
}
os = new FileOutputStream( file );
for( final Iterator i = consolidated.keySet().iterator(); i.hasNext(); )
{
final String language = (String) i.next();
final Properties lang = (Properties) consolidated.get( language );
System.out.println( "Processing language: " + language + ", " + lang.size() + " entries" );
for( final Iterator j = lang.keySet().iterator(); j.hasNext(); )
{
final String key = (String) j.next();
final String value = lang.getProperty( key );
index.insertObject( language + "#" + key, value );
}
}
System.out.println( "Index size: " + store.getSize() + " bytes" );
writeIndex( index, os );
}