public class SimpleContentStore extends Object implements ContentStore, org.springframework.context.Lifecycle
ContentStore
that stores all content and
meta data directly on disk in the WorkingDirectory
of jadice server.Constructor and Description |
---|
SimpleContentStore() |
Modifier and Type | Method and Description |
---|---|
void |
delete(String id)
Delete a
Stream |
TempFileReaper |
getTempFileReaper() |
WorkingDirectory |
getWorkingDirectory() |
boolean |
isRunning() |
Stream |
retrieveStream(String id)
Retrieve a
Stream |
void |
setTempFileReaper(TempFileReaper tempFileReaper)
Provide an optional
TempFileReaper which may take care of the content deletion |
void |
setWorkingDirectory(WorkingDirectory workingDirectory) |
void |
start() |
void |
stop() |
String |
storeStream(Stream stream)
Store a
Stream |
public String storeStream(Stream stream) throws IOException
ContentStore
Stream
storeStream
in interface ContentStore
stream
- the Stream
to storeIOException
- if the content could not be stored.ContentStore.retrieveStream(String)
,
ContentStore.delete(String)
public Stream retrieveStream(String id) throws IOException
ContentStore
Stream
retrieveStream
in interface ContentStore
id
- the ID of the contentStream
which has been stored under the given IDIOException
- if the content could not be retrieved.ContentStore.storeStream(Stream)
public void delete(String id)
ContentStore
Stream
delete
in interface ContentStore
id
- the ID of the contentContentStore.storeStream(Stream)
public WorkingDirectory getWorkingDirectory()
WorkingDirectory
where this implementation will store its contentspublic void setWorkingDirectory(WorkingDirectory workingDirectory) throws IOException
IOException
public TempFileReaper getTempFileReaper()
null
)public void setTempFileReaper(TempFileReaper tempFileReaper)
TempFileReaper
which may take care of the content deletionpublic void start()
start
in interface org.springframework.context.Lifecycle
public void stop()
stop
in interface org.springframework.context.Lifecycle
public boolean isRunning()
isRunning
in interface org.springframework.context.Lifecycle
Copyright © 2018 levigo holding gmbh. All rights reserved.