public boolean deleteUser ( String userName ) { // load user info from file if ( resourcePath != null ) { lock . writeLock ( ) . lock ( ) ; try { File userDir = new File ( resourcePath , "users" ) ; if ( userDir . isDirectory ( ) ) { // get the file which corresponds to the user File userFile = new File ( userDir . getAbsolutePath ( ) , userName ) ; return userFile . delete ( ) ; } } finally { lock . writeLock ( ) . unlock ( ) ; } } // end if resourcePath not null return false ; }
Deletes the user from the disk