Code example for FileEntity

0
                System.out.println("Cannot read file " + file.getPath()); 
                 
            } else { 
                 
                response.setStatusCode(HttpStatus.SC_OK); 
                FileEntity body = new FileEntity(file, "text/html");
                response.setEntity(body); 
                System.out.println("Serving file " + file.getPath()); 
                 
            } 
        } 
         
    } 
     
    static class EventLogger implements EventListener {
 
        public void connectionOpen(final NHttpConnection conn) {
            System.out.println("Connection open: " + conn);
        } 
 
Stop searching for code, let great code find you!  Add Codota to your java IDE