// Get fileNew content as a binary stream
final byte[] expectedBin = expected.getBytes("utf-8");
// Check lengths - this depends on the returned format of content.getSize()
final FileContent content = file.getContent();
System.out.println("file: " + file.getURL() + " type: " + file.getType());
System.out.println("content: " + content + " map: " + content.getAttributes());
Map map = content.getAttributes();
Iterator it = map.keySet().iterator();
while(it.hasNext())
{
String key = (String)(it.next());
}
assertEquals("same content length", expectedBin.length, content.getSize());
// Read content into byte array
final InputStream instr = content.getInputStream();
final ByteArrayOutputStream outstr;
try {
outstr = new ByteArrayOutputStream(expectedBin.length);
final byte[] buffer = new byte[256];
int nread = 0;