Sounds good. We should look into this at a later date, so that we have a
common case to store our data. Maybe eclipse has something similar, but we
are missing it.


On Mon, Nov 25, 2013 at 4:34 PM, Mihai Codoban <notifications@github.com>wrote:

> In
> edu.oregonstate.cope.eclipse/src/edu/oregonstate/cope/eclipse/SnapshotManager.java:
>
> > +		} catch (IOException e) {
> > +		}
> > +	}
> > +
> > +	public boolean isProjectKnown(String name) {
> > +		return knownProjects.contains(name);
> > +	}
> > +	
> > +	public boolean isProjectKnown(IProject project) {
> > +		return isProjectKnown(project.getName());
> > +	}
> > +
> > +	protected void knowProject(String string) {
> > +		knownProjects.add(string);
> > +		try {
> > +			Files.write(Paths.get(COPEPlugin.getLocalStorage().getAbsolutePath(), knownProjectsFileName), (string + "\n").getBytes(), StandardOpenOption.APPEND);
>
> With the SnapshotManager there are now 3 entities that need their data
> persisted (Config, Uninstaller, Snapshot). The only thing that differs is
> the persisted data type. All 3 use roughly the same logic to persist data.
>
> I should make a PersistedData (subclassed by PersistedList, PersistedSet
> and PersistedMap) that automatically persist themselves in a given
> directory. Then everybody else just uses these as their state and don't
> have to write their own persistence code.
>
> Watdcha say?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/ChangeOrientedProgrammingEnvironment/clientRecorder/pull/37/files#r7911516>
> .
>



-- 
Caius Brindescu