Example usage for javax.naming CompositeName add

List of usage examples for javax.naming CompositeName add

Introduction

In this page you can find the example usage for javax.naming CompositeName add.

Prototype

public Name add(int posn, String comp) throws InvalidNameException 

Source Link

Document

Adds a single component at a specified position within this composite name.

Usage

From source file:Main.java

public static void main(String[] argv) throws Exception {

    CompositeName composite = new CompositeName("cn=John,o=hits/summary.txt");
    String first = composite.get(0);
    String last = composite.get(composite.size() - 1);

    composite.add(0, "yourname.com");
    composite.remove(2);//from w  w  w  . j av  a  2s.  c  o  m
}