Examples of MemFile


Examples of gri.tasks.remote.files.MemFile

        if (elem.getAttribute("isNull") != null) {
            if (elem.getAttributeValue("isNull").toLowerCase().equals("true"))
                return null;
        }
       
        MemFile memFile = new MemFile();
       
        List children = elem.getChildren();
        Element child;
        for (int i=0; i<children.size(); i++) {
            child = (Element)children.get(i);
            String name = child.getName().toLowerCase();
           
            if (name.equals("name"))
                memFile.setName(child.getText());
           
            else if (name.equals("content")) {
                String encoding = child.getAttributeValue("encoding");
                if (encoding == null)
                    encoding = this.defaultEncoding;
               
                TextSerializer encoder = getEncoder(encoding);
                try {
                    byte [] content = (byte [])encoder.read(child.getText());
                    memFile.setContent(content);
                }
                catch(ParseException e) {
                    throw new IOException(e.getMessage());
                }
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.