Package org.alfresco.repo.content
Class EmptyContentReader
- java.lang.Object
-
- org.alfresco.repo.content.AbstractContentAccessor
-
- org.alfresco.repo.content.AbstractContentReader
-
- org.alfresco.repo.content.EmptyContentReader
-
- All Implemented Interfaces:
org.alfresco.service.cmr.repository.ContentAccessor,org.alfresco.service.cmr.repository.ContentReader
public class EmptyContentReader extends AbstractContentReader
A blank reader for whichexists()always returns false.- Author:
- Derek Hulley
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.alfresco.repo.content.AbstractContentAccessor
AbstractContentAccessor.CallbackFileChannel, AbstractContentAccessor.ChannelCloseCallbackAdvise
-
-
Constructor Summary
Constructors Constructor Description EmptyContentReader(java.lang.String contentUrl)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.alfresco.service.cmr.repository.ContentReadercreateReader()A factory method for subclasses to implement that will ensure the proper implementation of theContentReader.getReader()method.booleanexists()protected java.nio.channels.ReadableByteChannelgetDirectReadableChannel()Provides low-level access to read content from the repository.longgetLastModified()longgetSize()-
Methods inherited from class org.alfresco.repo.content.AbstractContentReader
addListener, compareContentReaders, getContent, getContent, getContentInputStream, getContentString, getContentString, getFileChannel, getLimits, getReadableChannel, getReader, getTransformerDebug, getUseBufferedInputStream, isChannelOpen, isClosed, setLimits, setTransformerDebug, setUseBufferedInputStream
-
Methods inherited from class org.alfresco.repo.content.AbstractContentAccessor
channelOpened, finalize, getCallbackFileChannel, getContentData, getContentUrl, getEncoding, getLocale, getMimetype, setContentUrl, setEncoding, setLocale, setMimetype, toString
-
-
-
-
Method Detail
-
createReader
protected org.alfresco.service.cmr.repository.ContentReader createReader() throws org.alfresco.service.cmr.repository.ContentIOExceptionDescription copied from class:AbstractContentReaderA factory method for subclasses to implement that will ensure the proper implementation of theContentReader.getReader()method.Only the instance need be constructed. The required mimetype, encoding, etc will be copied across by this class.
- Specified by:
createReaderin classAbstractContentReader- Returns:
- Returns an instance of the this class
- Throws:
org.alfresco.service.cmr.repository.ContentIOException
-
getDirectReadableChannel
protected java.nio.channels.ReadableByteChannel getDirectReadableChannel() throws org.alfresco.service.cmr.repository.ContentIOExceptionDescription copied from class:AbstractContentReaderProvides low-level access to read content from the repository.This is the only of the content reading methods that needs to be implemented by derived classes. All other content access methods make use of this in their underlying implementations.
- Specified by:
getDirectReadableChannelin classAbstractContentReader- Returns:
- Returns a channel from which content can be read
- Throws:
org.alfresco.service.cmr.repository.ContentIOException- if the channel could not be opened or the underlying content has disappeared
-
exists
public boolean exists()
-
getLastModified
public long getLastModified()
-
getSize
public long getSize()
-
-