@Deprecated
    public void addLibrary(Class<?> clazz, int port) {
        if (!server.isStopped()) // old behavior
            throw new IllegalStateException("Cannot add a library once the server is started");
        if (connector.getPort() != 0 && connector.getPort() != port) {
            throw new RuntimeException(
                    "Serving on multiple ports is no longer supported. Please use putLibrary with different paths instead.");
        }
        if (servlet.getLibraryMap().keySet().contains("/")) {
            throw new RuntimeException("A library has already been mapped to /.");
        }
        Object library;
        try {
            library = clazz.newInstance();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        setPort(port);
        putLibrary("/", library);
    }
@Deprecated
    public void addLibrary(Class<?> clazz, int port) {
        if (!server.isStopped()) 
            throw new IllegalStateException("Cannot add a library once the server is started");
        if (connector.getPort() != 0 && connector.getPort() != port) {
            throw new RuntimeException(
                    "Serving on multiple ports is no longer supported. Please use putLibrary with different paths instead.");
        }
        if (servlet.getLibraryMap().keySet().contains("/")) {
            throw new RuntimeException("A library has already been mapped to /.");
        }
        Object library;
        try {
            library = clazz.newInstance();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        setPort(port);
        putLibrary("/", library);
    }
@ Deprecated public void addLibrary ( Class < ? > clazz , int port ) { if ( ! server . isStopped ( ) ) // old behavior throw new IllegalStateException ( "Cannot add a library once the server is started" ) ; if ( connector . getPort ( ) != 0 && connector . getPort ( ) != port ) { throw new RuntimeException ( "Serving on multiple ports is no longer supported. Please use putLibrary with different paths instead." ) ; } if ( servlet . getLibraryMap ( ) . keySet ( ) . contains ( "/" ) ) { throw new RuntimeException ( "A library has already been mapped to /." ) ; } Object library ; try { library = clazz . newInstance ( ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } setPort ( port ) ; putLibrary ( "/" , library ) ; }
This has been deprecated. Please use {@link #putLibrary} and
{@link #setPort} instead.

Map the given test library to / and sets the port for the server. The
server must be stopped when calling this.

@param clazz
class of the test library
@param port
port for the server to listen on
This has been deprecated . Please use { @link #putLibrary } and { @link #setPort } instead .