
package cn.orionsec.ops.constant.app;

import lombok.Getter;

@Getter
public enum TransferMode {

    /**
     * scp
     */
    SCP,

    /**
     * sftp
     */
    SFTP,

    ;

    TransferMode() {
        this.value = name().toLowerCase();
    }

    private final String value;

    public static TransferMode of(String value) {
        if (value == null) {
            return SCP;
        }
        for (TransferMode type : values()) {
            if (type.value.equals(value)) {
                return type;
            }
        }
        return SCP;
    }

}
