|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.maven.issues.cache.AbstractFileTaskDataStore
public abstract class AbstractFileTaskDataStore
Base implementation of the TaskDataStore
interface that writes the task data to individual files.
Field Summary | |
---|---|
protected String |
fileNameExtension The extension to append to the created files. |
protected File |
persistentStoreDirectory The reference to the directory to store the individual task files. |
Constructor Summary | |
---|---|
protected |
AbstractFileTaskDataStore(File persistentStoreDirectory, String fileNameExtension) Default constructor. |
Method Summary | |
---|---|
protected static void |
close(Closeable closeable) Closes the given closeable and logs problems at error level to the log. |
protected static void |
close(File file, Closeable closeable) Closes the given closeable and logs problems at error level to the log. |
protected File |
createFile(String id) Creates a file for the given identifier. |
org.eclipse.mylyn.tasks.core.data.TaskData |
load(String id) Retrieves the task information. |
void |
persist(org.eclipse.mylyn.tasks.core.data.TaskData task) Persists the task information. |
protected org.eclipse.mylyn.tasks.core.data.TaskData |
readTask(File file) Reads the task from the given file. |
protected abstract org.eclipse.mylyn.tasks.core.data.TaskData |
readTask(InputStream inputStream) Reads the task from the given input stream. |
protected void |
writeTask(File file, org.eclipse.mylyn.tasks.core.data.TaskData task) Persists the task to the given file. |
protected abstract void |
writeTask(OutputStream outputStream, org.eclipse.mylyn.tasks.core.data.TaskData task) Persists the task to the given output stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final File persistentStoreDirectory
protected final String fileNameExtension
null
.
Constructor Detail |
---|
protected AbstractFileTaskDataStore(File persistentStoreDirectory, String fileNameExtension)
persistentStoreDirectory
- the reference to the directory to store the individual task files.
fileNameExtension
- the extension to append to the created files.
Method Detail |
---|
public org.eclipse.mylyn.tasks.core.data.TaskData load(String id) throws PersistenceException
load
in interface
TaskDataStore
id
- the unique identifier of the task information.
null
if no task data is stored for the given identifier.
PersistenceException
- if the task information cannot be retrieved.
protected File createFile(String id)
id
- the identifier of the file to be created.
protected org.eclipse.mylyn.tasks.core.data.TaskData readTask(File file) throws PersistenceException
file
- the file to read from.
PersistenceException
- if the task data cannot be read from the given file.
protected abstract org.eclipse.mylyn.tasks.core.data.TaskData readTask(InputStream inputStream) throws PersistenceException
inputStream
- the input stream to read from.
PersistenceException
- if the task data cannot be read from the given input stream.
public void persist(org.eclipse.mylyn.tasks.core.data.TaskData task) throws PersistenceException
persist
in interface
TaskDataStore
task
- the task information to persist.
PersistenceException
- if the task cannot be persisted.
protected void writeTask(File file, org.eclipse.mylyn.tasks.core.data.TaskData task) throws PersistenceException
file
- the file to write to.
task
- the task data to store.
PersistenceException
- if the task data cannot be written to the given file.
protected static void close(Closeable closeable)
closeable
- the closeable to close.
protected static void close(File file, Closeable closeable)
file
- the name of the file for logging.
closeable
- the closeable to close.
protected abstract void writeTask(OutputStream outputStream, org.eclipse.mylyn.tasks.core.data.TaskData task) throws PersistenceException
outputStream
- the output stream to write to.
task
- the task data to store.
PersistenceException
- if the task data cannot be written to the given output stream.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |