public void setLabel ( String label ) throws IllegalArgumentException , UnsupportedOperationException , IOException { checkRoot ( ) ; if ( label != null && label . length ( ) > MAX_LABEL_LENGTH ) throw new IllegalArgumentException ( "label too long" ) ; if ( this . volumeLabel != null ) { if ( label == null ) { changeSize ( getSize ( ) - 1 ) ; this . volumeLabel = null ; } else { ShortName . checkValidChars ( label . getBytes ( ShortName . ASCII ) ) ; this . volumeLabel = label ; } } else { if ( label != null ) { changeSize ( getSize ( ) + 1 ) ; ShortName . checkValidChars ( label . getBytes ( ShortName . ASCII ) ) ; this . volumeLabel = label ; } } this . dirty = true ; }
Sets the volume label that is stored in this directory . Setting the volume label is supported on the root directory only .