Package com.nabalive.data.core.model

Examples of com.nabalive.data.core.model.ApplicationLogo


                .get(new Route("/applications/:apikey/logo.png") {
                    @Override
                    public void handle(Request request, Response response, Map<String, String> map) throws Exception {
                        ChannelBuffer buffer;
                        String apikey = checkNotNull(map.get("apikey"));
                        ApplicationLogo applicationLogo = applicationLogoDAO.get(apikey);

                        if (applicationLogo != null)
                            buffer = ChannelBuffers.copiedBuffer(applicationLogo.getData());
                        else {
                            byte[] bytes = ByteStreams.toByteArray(getClass().getResourceAsStream("/app/default.png"));
                            buffer = ChannelBuffers.copiedBuffer(bytes);
                        }
View Full Code Here


        logger.debug("upsert: {}", dbObject);
        applicationStoreDAO.getCollection().update(query, dbObject, true, false, WriteConcern.SAFE);

        applicationLogoDAO.deleteById(application.getApikey());
        ApplicationLogo applicationLogo = new ApplicationLogo();
        applicationLogo.setData(logo);
        applicationLogo.setApikey(application.getApikey());
        applicationLogo.setContentType("application/octet-stream");
        applicationLogo.setFilename("logo.png");
        applicationLogoDAO.save(applicationLogo);

        applicationMap.put(application.getApikey(), application);
    }
View Full Code Here

TOP

Related Classes of com.nabalive.data.core.model.ApplicationLogo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.