private void archiveOrUnarchiveAsset(String uuid,
boolean archive) {
AssetItem item = rulesRepository.loadAssetByUUID( uuid );
serviceSecurity.checkIsPackageDeveloperOrAnalyst( item );
if ( item.getModule().isArchived() ) {
throw new RulesRepositoryException( "The package [" + item.getModuleName() + "] that asset [" + item.getName() + "] belongs to is archived. You need to unarchive it first." );
}
log.info( "USER:" + getCurrentUserName() + " ARCHIVING asset: [" + item.getName() + "] UUID: [" + item.getUUID() + "] " );
try {
ContentHandler handler = getContentHandler( item );
if ( handler instanceof ICanHasAttachment ) {