Package com.ettrema.httpclient

Examples of com.ettrema.httpclient.Folder.child()


      final HttpServletRequest req=ServletTestRunner.localRequest.get();
        Host hh=new Host(req.getServerName(),"/webdav/autopub",req.getServerPort(),"admin@dotcms.com","admin",null,null);
       
        Folder demo=(Folder)hh.child("demo.dotcms.com");
        Folder wt=(Folder)((Folder)demo.child("wt")).child(ff.getName());
        File wtFile=(File)wt.child("legacy.txt");
        final String newContent="new File content";
        wtFile.setContent(new ByteArrayInputStream(newContent.getBytes()), (long)newContent.getBytes().length);
       
        file = APILocator.getFileAPI().getWorkingFileById(file.getIdentifier(), user, false);
       
View Full Code Here


     
      final HttpServletRequest req=ServletTestRunner.localRequest.get();
        Host hh=new Host(req.getServerName(),"/webdav/autopub",req.getServerPort(),"admin@dotcms.com","admin",null,null);
       
        Folder demo=(Folder)hh.child("demo.dotcms.com");
        File f1=(File)demo.child(filename);
        f1.copyTo(demo, copyfilename);
        Thread.sleep(1000);
        File f2=(File)demo.child(copyfilename);
        ByteArrayOutputStream out1=new ByteArrayOutputStream(),out2=new ByteArrayOutputStream();
        f1.download(out1, null);
View Full Code Here

       
        Folder demo=(Folder)hh.child("demo.dotcms.com");
        File f1=(File)demo.child(filename);
        f1.copyTo(demo, copyfilename);
        Thread.sleep(1000);
        File f2=(File)demo.child(copyfilename);
        ByteArrayOutputStream out1=new ByteArrayOutputStream(),out2=new ByteArrayOutputStream();
        f1.download(out1, null);
        f2.download(out2, null);
        Assert.assertEquals("this is a test text", out1.toString());
        Assert.assertEquals("this is a test text", out2.toString());
View Full Code Here

       
        final HttpServletRequest req=ServletTestRunner.localRequest.get();
        Host hh=new Host(req.getServerName(),"/webdav/autopub",req.getServerPort(),"admin@dotcms.com","admin",null,null);
       
        Folder demo=(Folder)hh.child("demo.dotcms.com");
        File f1=(File)demo.child(filename);
        f1.delete();
       
        for(Resource rr: demo.children()) {
            if(rr instanceof File) {
                Assert.assertNotSame(filename, ((File)rr).name);
View Full Code Here

       
        final HttpServletRequest req=ServletTestRunner.localRequest.get();
        Host hh=new Host(req.getServerName(),"/webdav/autopub",req.getServerPort(),"admin@dotcms.com","admin",null,null);
       
        Folder demo=(Folder)hh.child("demo.dotcms.com");
        File f1=(File)demo.child(filename);
        f1.rename(renamefilename);
        Thread.sleep(1000);
        File f2=(File)demo.child(renamefilename);
        ByteArrayOutputStream out=new ByteArrayOutputStream();
        f2.download(out, null);
View Full Code Here

       
        Folder demo=(Folder)hh.child("demo.dotcms.com");
        File f1=(File)demo.child(filename);
        f1.rename(renamefilename);
        Thread.sleep(1000);
        File f2=(File)demo.child(renamefilename);
        ByteArrayOutputStream out=new ByteArrayOutputStream();
        f2.download(out, null);
        Assert.assertEquals("this is a test text", out.toString());
        f2.delete();
  }
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.