public Attribute renameGroupAttribute ( Group g , String oldName , String newName ) { if ( ! defineMode ) throw new UnsupportedOperationException ( "not in define mode" ) ; if ( ! isValidObjectName ( newName ) ) { String newnewName = createValidObjectName ( newName ) ; log . warn ( "illegal attribute name= " + newName + " change to " + newnewName ) ; newName = newnewName ; } if ( g == null ) g = ncfile . getRootGroup ( ) ; Attribute att = g . findAttribute ( oldName ) ; if ( null == att ) return null ; g . remove ( att ) ; att = new Attribute ( newName , att . getValues ( ) ) ; g . addAttribute ( att ) ; return att ; }
Rename a group Attribute . Must be in define mode .