package siprp.planoactuacao.print;

import java.io.File;
import java.io.FileOutputStream;
import java.util.Date;

import com.evolute.utils.data.Mappable;

public class LogotiposDumper
{
	public static void main( String args[] )
		throws Exception
	{
		System.out.println( "Dumper: " + new Date() );
		dump( args[ 0 ] );
	}
	
	public static void dump( String path )
		throws Exception
	{
		Mappable[] logotipos = PlanoActuacaoPrintDataProvider.getProvider().getLogotipos();
		for( Mappable logotipo : logotipos )
		{
			File file = new File( path, "" + logotipo.getID() + ".png" );
			file.createNewFile();
			FileOutputStream fos = new FileOutputStream( file );
			fos.write( ( byte[] ) logotipo.getValue() );
			fos.close();
		}
	}
	
	
}
