if ( isPreview ) {
return Utils.getSystemOrUserRWAccess( path ).saveFile( path, bais );
} else {
FileContent file = new FileContent();
file.setPath( path );
file.setContents( bais );
file.setTitle( title );
file.setDescription( description );
return PentahoCdeEnvironment.getInstance().getContentAccessFactory().getUserContentAccess( null )
.saveFile( file );
}