Examples of saveFile()


Examples of net.sourceforge.pebble.domain.FileManager.saveFile()

      fileManager.saveFile(path, name, content);

      // if it's a theme file, also save a copy to blog.dir/theme
      if (type.equals(FileMetaData.THEME_FILE)) {
        fileManager = new FileManager(blog, FileMetaData.BLOG_DATA);
        fileManager.saveFile("/theme" + path, name, content);
      }

      blog.info("File \"" + StringUtils.transformHTML(name) + "\" saved.");
    } catch (IllegalFileAccessException e) {
      return new ForbiddenView();
View Full Code Here

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

                        fileName = theForm.getPath() + "/" + fileName;
                    }
                   
                   
                    try {
                        fmgr.saveFile(website, fileName,
                                files[i].getContentType(),
                                files[i].getFileSize(),
                                files[i].getInputStream());
                       
                        uploaded.add(fileName);
View Full Code Here

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

            Roller roller = RollerFactory.getRoller();
            FileManager fmgr = roller.getFileManager();
            RollerMessages msgs = new RollerMessages();
           
            // Try to save file
            fmgr.saveFile(website, name, type, bits.length, new ByteArrayInputStream(bits));
           
            String fileLink = URLUtilities.getWeblogResourceURL(website, name, true);
           
            Hashtable returnStruct = new Hashtable(1);
            returnStruct.put("url", fileLink);
View Full Code Here

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

        // we should be starting with 0 files
        assertEquals(0, fmgr.getFiles(testWeblog, null).length);
       
        // store a file
        InputStream is = getClass().getResourceAsStream("/bookmarks.opml");
        fmgr.saveFile(testWeblog, "bookmarks.opml", "text/plain", 1545, is);
       
        // make sure file was stored successfully
        assertEquals("bookmarks.opml", fmgr.getFile(testWeblog, "bookmarks.opml").getName());
        assertEquals(1, fmgr.getFiles(testWeblog, null).length);
       
View Full Code Here

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

        assertEquals(1, dirs.length);
        assertEquals("bucket1", dirs[0].getName());
       
        // store a file into a subdirectory
        InputStream is = getClass().getResourceAsStream("/bookmarks.opml");
        fmgr.saveFile(testWeblog, "bucket1/bookmarks.opml", "text/plain", 1545, is);
       
        // make sure file was stored successfully
        assertEquals("bucket1/bookmarks.opml",
                fmgr.getFile(testWeblog, "bucket1/bookmarks.opml").getPath());
        assertEquals(1, fmgr.getFiles(testWeblog, "bucket1").length);
View Full Code Here

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

        Exception exception = null;
        InputStream is = null;
       
        try {
            // path check should fail
            fmgr.saveFile(testWeblog, "some/path/foo.gif", "text/plain", 10, is);
        } catch (Exception ex) {
            log.error(ex);
            exception = ex;
        }
        assertNotNull(exception);
View Full Code Here

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

        pmgr.saveProperties(config);
        TestUtils.endSession(true);
       
        try {
            // quota check should fail
            fmgr.saveFile(testWeblog, "test.gif", "text/plain", 2500000, is);
        } catch (Exception ex) {
            log.error(ex);
            exception = ex;
        }
        assertNotNull(exception);
View Full Code Here

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

        pmgr.saveProperties(config);
        TestUtils.endSession(true);
       
        try {
            // forbidden types check should fail
            fmgr.saveFile(testWeblog, "test.gif", "text/plain", 10, is);
        } catch (Exception ex) {
            log.error(ex);
            exception = ex;
        }
        assertNotNull(exception);
View Full Code Here

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

        pmgr.saveProperties(config);
        TestUtils.endSession(true);
       
        try {
            // uploads disabled should fail
            fmgr.saveFile(testWeblog, "test.gif", "text/plain", 10, is);
        } catch (Exception ex) {
            log.error(ex);
            exception = ex;
        }
        assertNotNull(exception);
View Full Code Here

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

               
                try {
                    if(resourceFile.isDirectory()) {
                        fileMgr.createDirectory(website, path);
                    } else {
                        fileMgr.saveFile(website, path, "text/plain",
                                resourceFile.length(), new FileInputStream(resourceFile));
                    }
                } catch (Exception ex) {
                    log.info(ex);
                }
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.