if ( file.isFile() ) {
if ( !file.isDirectory() ) {
    public void deleteDirectory(FTPFile directory) throws IOException, FtpIOException, FtpWorkflowException {        if ( !directory.isDirectory() )            throw new FtpFileNotFoundException("Deleting: " + directory.getName() + " is not possible, it's not a directory!");        List<FTPFile> files = getDirectoryListing( directory.toString() );                Collections.sort( files );                for(FTPFile file : files) {            file.setPath( directory.toString() );            if ( file.isFile() ) {                deleteFile( file );            }else {                deleteDirectory( file );//                removeDirectory( file );            }        }                removeDirectory(directory);    }