Package org.alfresco.repo.content.http
Class HttpAlfrescoContentReader
java.lang.Object
org.alfresco.repo.content.AbstractContentAccessor
org.alfresco.repo.content.AbstractContentReader
org.alfresco.repo.content.http.HttpAlfrescoContentReader
- All Implemented Interfaces:
ContentAccessor,ContentReader
The reader that does the actual communication with the Alfresco HTTP application.
- Since:
- 2.1
- Author:
- Derek Hulley
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.alfresco.repo.content.AbstractContentAccessor
AbstractContentAccessor.CallbackFileChannel, AbstractContentAccessor.ChannelCloseCallbackAdvise -
Constructor Summary
ConstructorsConstructorDescriptionHttpAlfrescoContentReader(TransactionService transactionService, AuthenticationService authenticationService, String baseHttpUrl, String contentUrl) -
Method Summary
Modifier and TypeMethodDescriptionprotected ContentReaderA factory method for subclasses to implement that will ensure the proper implementation of theContentReader.getReader()method.booleanexists()static final StringgenerateURL(String baseHttpUrl, String contentUrl, String ticket, boolean infoOnly) Helper to generate a URL based on the ContentStore URL and ticket.protected ReadableByteChannelProvides low-level access to read content from the repository.longlonggetSize()toString()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, setUseBufferedInputStreamMethods inherited from class org.alfresco.repo.content.AbstractContentAccessor
channelOpened, finalize, getCallbackFileChannel, getContentData, getContentUrl, getEncoding, getLocale, getMimetype, setContentUrl, setEncoding, setLocale, setMimetypeMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.alfresco.service.cmr.repository.ContentAccessor
getContentData, getContentUrl, getEncoding, getLocale, getMimetype, setEncoding, setLocale, setMimetype
-
Constructor Details
-
HttpAlfrescoContentReader
public HttpAlfrescoContentReader(TransactionService transactionService, AuthenticationService authenticationService, String baseHttpUrl, String contentUrl)
-
-
Method Details
-
toString
- Overrides:
toStringin classAbstractContentAccessor
-
exists
public boolean exists() -
getLastModified
public long getLastModified() -
getSize
public long getSize() -
createReader
Description 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 a reader onto the location referenced by this instance. The instance must always be a new instance.
- Throws:
ContentIOException
-
getDirectReadableChannel
Description 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:
ContentIOException- if the channel could not be opened or the underlying content has disappeared
-
generateURL
public static final String generateURL(String baseHttpUrl, String contentUrl, String ticket, boolean infoOnly) Helper to generate a URL based on the ContentStore URL and ticket.- Parameters:
baseHttpUrl- the first part of the URL pointing to the Alfresoc Web ApplicationcontentUrl- the content URL - never nullticket- the authentication ticketinfoOnly- true to add the info-only flag- Returns:
- Returns the URL with which to access the servlet
-