public void setInitialAttributes ( File file , FileAttribute < ? > ... attrs ) { // default values should already be sanitized by their providers for ( int i = 0 ; i < defaultValues . size ( ) ; i ++ ) { FileAttribute < ? > attribute = defaultValues . get ( i ) ; int separatorIndex = attribute . name ( ) . indexOf ( ' ' ) ; String view = attribute . name ( ) . substring ( 0 , separatorIndex ) ; String attr = attribute . name ( ) . substring ( separatorIndex + 1 ) ; file . setAttribute ( view , attr , attribute . value ( ) ) ; } for ( FileAttribute < ? > attr : attrs ) { setAttribute ( file , attr . name ( ) , attr . value ( ) , true ) ; } }
Sets all initial attributes for the given file including the given attributes if possible .