}
String id = getFileTypeId();
String pattern = getPattern();
FileType filetype = findFileType( id );
if ( filetype == null )
{
addActionError( "Pattern not added, unable to find filetype " + id );
return INPUT;
}
if ( filetype.getPatterns().contains( pattern ) )
{
addActionError( "Not adding pattern \"" + pattern + "\" to filetype " + id + " as it already exists." );
return INPUT;
}
filetype.addPattern( pattern );
addActionMessage( "Added pattern \"" + pattern + "\" to filetype " + id );
return saveConfiguration();
}