Examples of saveFile()


Examples of org.apache.roller.business.FileManager.saveFile()

                    Utilities.copyInputToOutput(is, fos);
                    fos.close();

                    // Try saving file
                    FileInputStream fis = new FileInputStream(tempFile);
                    fmgr.saveFile(website, fileName, contentType, tempFile.length(), fis);
                    fis.close();
                   
                    WeblogResource resource = fmgr.getFile(website, fileName);
                    return createAtomResourceEntry(website, resource);
View Full Code Here

Examples of org.apache.roller.model.FileManager.saveFile()

                        fileSize = files[i].getFileSize();

                        //retrieve the file data
                        if (fmgr.canSave(website.getHandle(), fileName, fileSize, rollerMessages)) {
                            InputStream stream = files[i].getInputStream();
                            fmgr.saveFile(website.getHandle(), fileName, fileSize, stream);
                            lastUploads.add(fileName);
                        }
                       
                        //destroy the temporary file created
                        files[i].destroy();
View Full Code Here

Examples of org.apache.roller.model.FileManager.saveFile()

        FileManager fmgr = RollerFactory.getRoller().getFileManager();
        RollerMessages msgs = new RollerMessages();
       
        // store a file
        InputStream is = getClass().getResourceAsStream("/bookmarks.opml");
        fmgr.saveFile(testWeblog.getHandle(), "bookmarks.opml", 1545, is);
       
        // make sure file was stored successfully
        assertEquals(1, fmgr.getFiles(testWeblog.getHandle()).length);
       
        // delete a file
View Full Code Here

Examples of org.apache.roller.model.FileManager.saveFile()

            RollerMessages msgs = new RollerMessages();
           
            // If save is allowed by Roller system-wide policies
            if (fmgr.canSave(website.getHandle(), name, bits.length, msgs)) {
                // Then save the file
                fmgr.saveFile(
                        website.getHandle(), name, bits.length, new ByteArrayInputStream(bits));
               
                RollerRequest rreq = RollerRequest.getRollerRequest();
                HttpServletRequest request = rreq.getRequest();
               
View Full Code Here

Examples of org.apache.roller.model.FileManager.saveFile()

               
                // If save is allowed by Roller system-wide policies
                if (fmgr.canSave(website.getHandle(), name, tempFile.length(), msgs)) {
                    // Then save the file
                    FileInputStream fis = new FileInputStream(tempFile);
                    fmgr.saveFile(website.getHandle(), name, tempFile.length(), fis);
                    fis.close();
                   
                    File resource = new File(fmgr.getUploadDir() + File.separator + name);
                    return createAtomResourceEntry(website, resource);
                }
View Full Code Here

Examples of org.apache.roller.weblogger.business.FileManager.saveFile()

                    fileName = getPath() + "/" + fileName;
                }
               
               
                try {
                    fmgr.saveFile(getActionWeblog(),
                            fileName,
                            getUploadedFilesContentType()[i],
                            uploads[i].length(),
                            new FileInputStream(uploads[i]));
                   
View Full Code Here

Examples of org.apache.roller.weblogger.business.FileManager.saveFile()

                try {
                    if(resource.isDirectory()) {
                        fileMgr.createDirectory(website, resource.getPath());
                    } else {
                        // save file without file-type, quota checks, etc.
                        fileMgr.saveFile(website, resource.getPath(), "text/plain",
                                resource.getLength(), resource.getInputStream(), false);
                    }
                } catch (Exception ex) {
                    log.info(ex);
                }
View Full Code Here

Examples of org.apache.roller.weblogger.business.FileManager.saveFile()

                    // Parse pathinfo to determine file path
                    String path = filePathFromPathInfo(pathInfo);
                   
                    if (path.length() > 0) path = path + File.separator;
                    FileInputStream fis = new FileInputStream(tempFile)
                    fmgr.saveFile(website, path + fileName, contentType, tempFile.length(), fis);
                    fis.close();
                   
                    ThemeResource resource = fmgr.getFile(website, path + fileName);
                   
                    log.debug("Exiting");
View Full Code Here

Examples of org.apache.roller.weblogger.business.FileManager.saveFile()

                   
                    // Attempt to load file, to ensure it exists
                    ThemeResource resource = fmgr.getFile(website, path);                   
                   
                    FileInputStream fis = new FileInputStream(tempFile)
                    fmgr.saveFile(website, path, contentType, tempFile.length(), fis);
                    fis.close();
                   
                    log.debug("Exiting");
                    return createAtomResourceEntry(website, resource);
View Full Code Here

Examples of org.apache.roller.weblogger.business.FileManager.saveFile()

            Weblogger roller = WebloggerFactory.getWeblogger();
            FileManager fmgr = roller.getFileManager();
            RollerMessages msgs = new RollerMessages();
           
            // Try to save file
            fmgr.saveFile(website, name, type, bits.length, new ByteArrayInputStream(bits));
           
            String fileLink = WebloggerFactory.getWeblogger().getUrlStrategy().getWeblogResourceURL(website, name, true);
           
            Hashtable returnStruct = new Hashtable(1);
            returnStruct.put("url", fileLink);
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.