Package com.ettrema.httpclient

Examples of com.ettrema.httpclient.File.download()


     
      ByteArrayOutputStream sw1=new ByteArrayOutputStream();
      r1.download(sw1, null);
     
      ByteArrayOutputStream sw2=new ByteArrayOutputStream();
      r2.download(sw2, null);
     
      assertEquals("text1",sw1.toString());
      assertEquals("text2",sw2.toString());
  }
 
View Full Code Here


        // the file should have the new content
        Assert.assertEquals(newContent, IOUtils.toString(new FileReader(APILocator.getFileAPI().getAssetIOFile(file))));
       
        // testing that webdav returns the same
        ByteArrayOutputStream out=new ByteArrayOutputStream();
        wtFile.download(out, null);
        Assert.assertEquals(newContent,new String(out.toByteArray()));
  }
 
  /**
   * https://github.com/dotCMS/dotCMS/issues/3656
 
View Full Code Here

        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());
       
        f1.delete();
        f2.delete();
View Full Code Here

        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.