|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.repo.content.AbstractContentAccessor
org.alfresco.repo.content.AbstractContentWriter
org.alfresco.repo.content.filestore.FileContentWriter
public class FileContentWriter
Provides direct access to a local file.
This class does not provide remote access to the file.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.alfresco.repo.content.AbstractContentAccessor |
---|
AbstractContentAccessor.CallbackFileChannel, AbstractContentAccessor.ChannelCloseCallbackAdvise |
Constructor Summary | |
---|---|
FileContentWriter(java.io.File file)
Constructor that builds a URL based on the absolute path of the file. |
|
FileContentWriter(java.io.File file,
org.alfresco.service.cmr.repository.ContentReader existingContentReader)
Constructor that builds a URL based on the absolute path of the file. |
|
FileContentWriter(java.io.File file,
java.lang.String url,
org.alfresco.service.cmr.repository.ContentReader existingContentReader)
Constructor that explicitely sets the URL that the reader represents. |
Method Summary | |
---|---|
boolean |
canWrite()
|
protected org.alfresco.service.cmr.repository.ContentReader |
createReader()
The URL of the write is known from the start and this method contract states that no consideration needs to be taken w.r.t. |
protected java.nio.channels.WritableByteChannel |
getDirectWritableChannel()
Provides low-level access to write content to the repository. |
java.io.File |
getFile()
|
long |
getSize()
|
Methods inherited from class org.alfresco.repo.content.AbstractContentWriter |
---|
addListener, getContentOutputStream, getExistingContentReader, getFileChannel, getReader, getWritableChannel, guessEncoding, guessMimetype, isChannelOpen, isClosed, putContent, putContent, putContent, putContent, setMimetypeService |
Methods inherited from class org.alfresco.repo.content.AbstractContentAccessor |
---|
channelOpened, finalize, getCallbackFileChannel, getContentData, getContentUrl, getEncoding, getLocale, getMimetype, setContentUrl, setEncoding, setLocale, setMimetype, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.alfresco.service.cmr.repository.ContentAccessor |
---|
getContentData, getContentUrl, getEncoding, getLocale, getMimetype, setEncoding, setLocale, setMimetype |
Constructor Detail |
---|
public FileContentWriter(java.io.File file)
file
- the file for writing. This will most likely be directly
related to the content URL.public FileContentWriter(java.io.File file, org.alfresco.service.cmr.repository.ContentReader existingContentReader)
file
- the file for writing. This will most likely be directly
related to the content URL.existingContentReader
- a reader of a previous version of this contentpublic FileContentWriter(java.io.File file, java.lang.String url, org.alfresco.service.cmr.repository.ContentReader existingContentReader)
file
- the file for writing. This will most likely be directly
related to the content URL.url
- the relative url that the reader representsexistingContentReader
- a reader of a previous version of this contentMethod Detail |
---|
public java.io.File getFile()
public long getSize()
protected org.alfresco.service.cmr.repository.ContentReader createReader() throws org.alfresco.service.cmr.repository.ContentIOException
createReader
in class AbstractContentWriter
org.alfresco.service.cmr.repository.ContentIOException
protected java.nio.channels.WritableByteChannel getDirectWritableChannel() throws org.alfresco.service.cmr.repository.ContentIOException
AbstractContentWriter
This is the only of the content writing methods that needs to be implemented by derived classes. All other content access methods make use of this in their underlying implementations.
getDirectWritableChannel
in class AbstractContentWriter
org.alfresco.service.cmr.repository.ContentIOException
- if the channel could not be openedpublic boolean canWrite()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |