Package org.internna.iwebmvc.model.core

Examples of org.internna.iwebmvc.model.core.Audio


    }

    @Override
    @SuppressWarnings("unchecked")
    public void setAsText(String text) throws IllegalArgumentException {
        Audio doc = (Audio) getValue();
        Properties properties = new Properties();
        try {
            properties.load(IOUtils.toInputStream(text));
            String uri = properties.getProperty("uri");
            Assert.isEncrypted(decipherer, uri);
            if (doc == null) doc = new Audio();
            doc.setUri(decipherer.decrypt(uri));
            doc.setMimeType(properties.getProperty("mimeType"));
            doc.setIdentifier(properties.getProperty("identifier"));
            doc.setCreated(dateFormat.parse(properties.getProperty("created")));
            doc.setSizeInBytes(Long.parseLong(properties.getProperty("sizeInBytes")));
        } catch (Exception ex) {
            if (log.isDebugEnabled()) log.debug("Could not completely bind [" + text + "] as an Audio: " + ex.getMessage());
        }
        setValue(doc);
    }
View Full Code Here


        this.decipherer = decipherer;
    }

    @SuppressWarnings("unchecked")
    public Audio getAudio(String text) throws IllegalArgumentException {
        Audio doc = new Audio();
        Properties properties = new Properties();
        try {
            properties.load(IOUtils.toInputStream(text));
            String uri = properties.getProperty("uri");
            Assert.isEncrypted(decipherer, uri);
            if (doc == null) doc = new Audio();
            doc.setUri(decipherer.decrypt(uri));
            doc.setMimeType(properties.getProperty("mimeType"));
            doc.setIdentifier(properties.getProperty("identifier"));
            doc.setCreated(dateFormat.parse(properties.getProperty("created")));
            doc.setSizeInBytes(Long.parseLong(properties.getProperty("sizeInBytes")));
            return doc;
        } catch (Exception ex) {
            if (log.isDebugEnabled()) log.debug("Could not completely bind [" + text + "] as an Audio: " + ex.getMessage());
        }
        return null;
View Full Code Here

        for (String doc : text.split("##")) {
            if (StringUtils.hasText(doc)) {
                if (doc.startsWith("-")) {
                    Iterator<Audio> it = docs.getPlayList().iterator();
                    while (it.hasNext()) {
                        Audio d = it.next();
                        if (doc.substring(1).equals(d.getUri())) it.remove();
                    }
                } else {
                    Audio document = getAudio(doc);
                    if (document != null) docs.addAudio(document);
                }
            }
        }
        setValue(docs);
View Full Code Here

TOP

Related Classes of org.internna.iwebmvc.model.core.Audio

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.