public void removeDirectory ( String path ) throws SftpStatusException , SshException { try { UnsignedInteger32 requestId = nextRequestId ( ) ; Packet msg = createPacket ( ) ; msg . write ( SSH_FXP_RMDIR ) ; msg . writeInt ( requestId . longValue ( ) ) ; msg . writeString ( path , CHARSET_ENCODING ) ; sendMessage ( msg ) ; getOKRequestStatus ( requestId ) ; } catch ( SshIOException ex ) { throw ex . getRealException ( ) ; } catch ( IOException ex ) { throw new SshException ( ex ) ; } EventServiceImplementation . getInstance ( ) . fireEvent ( ( new Event ( this , J2SSHEventCodes . EVENT_SFTP_DIRECTORY_DELETED , true ) ) . addAttribute ( J2SSHEventCodes . ATTRIBUTE_DIRECTORY_PATH , path ) ) ; }
Remove an empty directory .