@Override public long getSize() { return delegatee.getSize(); }
@Override public long getSize() { return delegatee.getSize(); }
ContentWriter contentWriter = contentService.getWriter(noderef, ContentModel.PROP_CONTENT, true); contentWriter.setMimetype("text/csv"); FileChannel fileChannel = contentWriter.getFileChannel(false); ByteBuffer bf = ByteBuffer.wrap(logLine.getBytes()); try { fileChannel.position(contentWriter.getSize()); fileChannel.write(bf); fileChannel.force(false); fileChannel.close(); } catch (IOException e){ e.printStackTrace(); }
when(cacheWriter.getReader()).thenReturn(readerFromCacheWriter); when(readerFromCacheWriter.exists()).thenReturn(true); when(cacheWriter.getSize()).thenReturn(54321L); QuotaManagerStrategy quota = mock(QuotaManagerStrategy.class); cachingStore.setQuota(quota);
when(cacheWriter.getReader()).thenReturn(readerFromCacheWriter); when(readerFromCacheWriter.exists()).thenReturn(true); when(cacheWriter.getSize()).thenReturn(54321L); QuotaManagerStrategy quota = mock(QuotaManagerStrategy.class); cachingStore.setQuota(quota);
assertEquals("Cache writer should still return actual size", overLimitSize, writer.getSize()); assertEquals("Cache writer should still return actual size", overLimitSize, writer.getContentData().getSize());
public void testGetRawReader() throws Exception { ContentReader reader = contentService.getRawReader("test://non-existence"); assertNotNull("A reader is expected with content URL referencing no content", reader); assertFalse("Reader should not have any content", reader.exists()); // Now write something ContentWriter writer = contentService.getWriter(contentNodeRef, ContentModel.PROP_CONTENT, false); writer.putContent("ABC from " + getName()); // Try again String contentUrl = writer.getContentUrl(); reader = contentService.getRawReader(contentUrl); assertNotNull("Expected reader for live, raw content", reader); assertEquals("Content sizes don't match", writer.getSize(), reader.getSize()); }
+ " as at be but by for if in into is it no not of on or such that the their then there these they this to was will with: " + " and random charcters \u00E0\u00EA\u00EE\u00F0\u00F1\u00F6\u00FB\u00FF"); contentLength0 = writer0.getSize(); contentUrl0 = DefaultTypeConverter.INSTANCE.convert(ContentData.class, nodeService.getProperty(c0, ContentModel.PROP_CONTENT)).getContentUrl(); nodeService.addAspect(c0, ContentModel.ASPECT_TITLED, null);
assertTrue("File transformation failed. Output file size is '0'", outputWriter.getSize() > 0);