All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.cli.impl.CliAliasManager Maven / Gradle / Ivy

package org.infinispan.cli.impl;

import java.io.File;
import java.io.IOException;

import org.aesh.command.registry.CommandRegistry;
import org.aesh.readline.alias.AliasManager;

public class CliAliasManager extends AliasManager {

    private final CommandRegistry registry;

    public CliAliasManager(File aliasFile, boolean persistAlias,
                           CommandRegistry registry) throws IOException {
           super(aliasFile, persistAlias);
           this.registry = registry;
    }

    @Override
    public boolean verifyNoNewAliasConflict(String aliasName) {
        if(registry != null && registry.contains(aliasName))
            return false;
        else
            return true;
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy