public class FileAnonymize
{
public static class MyWatcher extends SimpleSubjectWatcher
{
public MyWatcher(Subject s) { super(s,"Override String"); }
protected void ShowProgress(Subject caller, Event evt)
{
ProgressEvent pe = ProgressEvent.Cast(evt);
System.out.println( "This is my progress: " + pe.GetProgress() );
}
}
public static void main(String[] args) throws Exception
{
String input = args[0];
String output = args[1];
FileAnonymizer fa = new FileAnonymizer();
fa.SetInputFileName( input );
fa.SetOutputFileName( output );
fa.Empty( new Tag(0x0008,0x1313) );
fa.Empty( new Tag(0x0008,0x1317) );
fa.Remove( new Tag(0x0008,0x2112) );
fa.Remove( new Tag(0x0008,0x9215) );
fa.Replace( new Tag(0x0018,0x5100), "MYVALUE " );
fa.Replace( new Tag(0x0008,0x1160), "MYOTHERVAL" );
if( !fa.Write() )
{
System.out.println( "Could not write" );
return;
}
System.out.println( "success" );
}
}