Code example for ByteArrayEntity

Methods: setContentType

0
 
    /** 
     * Create a string entity for the given content. 
     */ 
    private ByteArrayEntity createEntity(byte[] data) {
        ByteArrayEntity entity = new ByteArrayEntity(data);
        entity.setContentType("text/html");
        return entity;
    } 
 
    private static class ServerThread extends Thread {
        private TestWebServer mServer;
        private ServerSocket mSocket;
        private boolean mIsSsl;
        private boolean mIsCancelled;
        private SSLContext mSslContext;
 
        /** 
         * Defines the keystore contents for the server, BKS version. Holds just a 
         * single self-generated key. The subject name is "Test Server". 
         */