@Override public boolean exists() { return delegatee.exists(); }
@Override public boolean exists() { return delegatee.exists(); }
/** * Simple implementation that uses the * {@link ContentReader#exists() reader's exists} method as its implementation. * Override this method if a more efficient implementation is possible. */ @Override public boolean exists(String contentUrl) { ContentReader reader = getReader(contentUrl); return reader.exists(); }
/** * Simple implementation that uses the * {@link ContentReader#exists() reader's exists} method as its implementation. * Override this method if a more efficient implementation is possible. */ @Override public boolean exists(String contentUrl) { ContentReader reader = getReader(contentUrl); return reader.exists(); }
public ContentReader makeContentReader() { QName srcContentProp = getParamWithDefault(PARAM_SOURCE_CONTENT_PROPERTY, DEFAULT_CONTENT_PROPERTY); ContentReader contentReader = contentService.getReader(sourceNode, srcContentProp); if (contentReader == null || !contentReader.exists()) { throw new UnimportantTransformException(CONTENT_READER_NOT_FOUND_MESSAGE); } return contentReader; }
public ContentReader makeContentReader() { QName srcContentProp = getParamWithDefault(PARAM_SOURCE_CONTENT_PROPERTY, DEFAULT_CONTENT_PROPERTY); ContentReader contentReader = contentService.getReader(sourceNode, srcContentProp); if (contentReader == null || !contentReader.exists()) { throw new UnimportantTransformException(CONTENT_READER_NOT_FOUND_MESSAGE); } return contentReader; }
public String getContent() { ContentService contentService = services.getContentService(); ContentReader reader = contentService.getReader(nodeRef, property); return (reader != null && reader.exists()) ? reader.getContentString() : ""; }
protected boolean sourceNodeIsXml(NodeRef sourceNode) { boolean result = false; // TODO: BJR 20100211: We can do better than this... ContentReader reader = serviceRegistry.getContentService().getReader(sourceNode, ContentModel.PROP_CONTENT); if ((reader != null) && reader.exists()) { result = (reader.getContentData().getMimetype().equals("text/xml")); } return result; }
@Override public long getSize() { if (!this.cacheWriter.getReader().exists()) { return this.bsWriter.getSize(); } return this.cacheWriter.getSize(); }
@Override public ContentData getContentData() { if (!this.cacheWriter.getReader().exists()) { return this.bsWriter.getContentData(); } return this.cacheWriter.getContentData(); }
public InputStream getInputStream() { ContentService contentService = services.getContentService(); ContentReader reader = contentService.getReader(nodeRef, property); return (reader != null && reader.exists()) ? reader.getContentInputStream() : null; }
@Override public ContentData getContentData() { if (!this.cacheWriter.getReader().exists()) { return this.bsWriter.getContentData(); } return this.cacheWriter.getContentData(); }
@Override public long getSize() { if (!this.cacheWriter.getReader().exists()) { return this.bsWriter.getSize(); } return this.cacheWriter.getSize(); }
public String getContent() { ContentService contentService = services.getContentService(); ContentReader reader = contentService.getReader(nodeRef, property); return (reader != null && reader.exists()) ? reader.getContentString() : ""; }
/** * @return the content stream */ public String getContent() { ContentService contentService = services.getContentService(); ContentReader reader = contentService.getReader(getNodeRef(), property); return (reader != null && reader.exists()) ? reader.getContentString() : ""; }
/** * @return the content stream to the specified maximum length in characters */ public String getContentMaxLength(int length) { ContentService contentService = services.getContentService(); ContentReader reader = contentService.getReader(getNodeRef(), property); return (reader != null && reader.exists()) ? reader.getContentString(length) : ""; }
/** * @return the content stream to the specified maximum length in characters */ public String getContentMaxLength(int length) { ContentService contentService = services.getContentService(); ContentReader reader = contentService.getReader(getNodeRef(), property); return (reader != null && reader.exists()) ? reader.getContentString(length) : ""; }
/** * @return the content stream */ public String getContent() { ContentService contentService = services.getContentService(); ContentReader reader = contentService.getReader(getNodeRef(), property); return (reader != null && reader.exists()) ? reader.getContentString() : ""; }
@Test public void spoofedGetReader() { cachingStore = new CachingContentStore(backingStore, cache, true); String url = SpoofedTextContentReader.createContentUrl(Locale.ENGLISH, 0L, 1024L); ContentReader reader = cachingStore.getReader(url); assertTrue(reader.exists()); assertEquals(1024, reader.getSize()); verify(backingStore, never()).getReader(anyString()); }
public void testDelete() throws Exception { // write some content ContentWriter writer = getWriter(); writer.putContent(SOME_CONTENT); String contentUrl = writer.getContentUrl(); ContentReader reader = primaryStore.getReader(contentUrl); assertTrue("Content was not in the primary store", reader.exists()); assertEquals("The content was incorrect", SOME_CONTENT, reader.getContentString()); getStore().delete(contentUrl); checkForUrl(contentUrl, false); }