// Path: centrepoint/modules/model/src/main/java/com/effectivemaven/centrepoint/model/plugin/PluginManager.java
// public interface PluginManager
// {
//     /**
//      * Retrieve all plugins available (whether they are configurable or not).
//      * 
//      * @return the list of plugins
//      */
//     Collection<PanelPlugin> getPlugins();
// 
//     /**
//      * Retrieve all plugins available that take configuration options.
//      * 
//      * @return the list of configurable plugins
//      */
//     Collection<ConfigurablePanel<? extends ExtensionModel>> getConfigurablePlugins();
// 
//     /**
//      * Retrieve a specific configurable plugin, based on the ID of the configuration model.
//      * 
//      * @param id the ID of the plugin's configuration model, which should match the value of
//      *            {@link ConfigurablePanel#getId()}
//      * @return the plugin, or <tt>null</tt> if not found
//      */
//     ConfigurablePanel<? extends ExtensionModel> getConfigurablePlugin( String id );
// }
// 
// Path: centrepoint/modules/store-api/src/main/java/com/effectivemaven/centrepoint/store/ProjectStore.java
// public interface ProjectStore
// {
//     /**
//      * Retrieve all projects in their entirety.
//      * @return the project list
//      */
//     Collection<Project> getAllProjects();
// 
//     /**
//      * Retrieve a specific project.
//      * @param id the identifier of the project to retrieve
//      * @return the project, or <code>null</code> if not found
//      */
//     Project getProjectById( String id );
// 
//     /**
//      * Store the project. 
//      * @param project the project to store
//      */
//     void store( Project project );
// }


import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.logging.Logger;
import com.effectivemaven.centrepoint.model.ExtensionModel;
import com.effectivemaven.centrepoint.model.MavenCoordinates;
import com.effectivemaven.centrepoint.model.Project;
import com.effectivemaven.centrepoint.model.plugin.ConfigurablePanel;
import com.effectivemaven.centrepoint.model.plugin.PluginManager;
import com.effectivemaven.centrepoint.store.ProjectStore;
import com.google.inject.Inject;
package com.effectivemaven.centrepoint.store.properties;

/**
 * Copyright 2009
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License. 
 */



public class PropertiesProjectStore
    implements ProjectStore
{
    /** The projects, cached in memory. */
    private Map<String, Project> projects = new LinkedHashMap<String, Project>();

    /** Where to save the projects on disk. */
    private String dataLocation;

    /** Logger. */
    private static Logger logger = Logger.getLogger( PropertiesProjectStore.class.getName() );

    /**
     * Configuration parameters that can be modified by alternate bindings in Guice.
     */
    static class RepositoryParams
    {
        @Inject( optional = true )
        private @DataLocation
        String dataLocation = System.getProperty( "user.home" ) + "/.centrepoint/";
    }

    @Inject
// Path: centrepoint/modules/model/src/main/java/com/effectivemaven/centrepoint/model/plugin/PluginManager.java
// public interface PluginManager
// {
//     /**
//      * Retrieve all plugins available (whether they are configurable or not).
//      * 
//      * @return the list of plugins
//      */
//     Collection<PanelPlugin> getPlugins();
// 
//     /**
//      * Retrieve all plugins available that take configuration options.
//      * 
//      * @return the list of configurable plugins
//      */
//     Collection<ConfigurablePanel<? extends ExtensionModel>> getConfigurablePlugins();
// 
//     /**
//      * Retrieve a specific configurable plugin, based on the ID of the configuration model.
//      * 
//      * @param id the ID of the plugin's configuration model, which should match the value of
//      *            {@link ConfigurablePanel#getId()}
//      * @return the plugin, or <tt>null</tt> if not found
//      */
//     ConfigurablePanel<? extends ExtensionModel> getConfigurablePlugin( String id );
// }
// 
// Path: centrepoint/modules/store-api/src/main/java/com/effectivemaven/centrepoint/store/ProjectStore.java
// public interface ProjectStore
// {
//     /**
//      * Retrieve all projects in their entirety.
//      * @return the project list
//      */
//     Collection<Project> getAllProjects();
// 
//     /**
//      * Retrieve a specific project.
//      * @param id the identifier of the project to retrieve
//      * @return the project, or <code>null</code> if not found
//      */
//     Project getProjectById( String id );
// 
//     /**
//      * Store the project. 
//      * @param project the project to store
//      */
//     void store( Project project );
// }


// Path: centrepoint/modules/store-file/src/main/java/com/effectivemaven/centrepoint/store/properties/PropertiesProjectStore.java
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.logging.Logger;
import com.effectivemaven.centrepoint.model.ExtensionModel;
import com.effectivemaven.centrepoint.model.MavenCoordinates;
import com.effectivemaven.centrepoint.model.Project;
import com.effectivemaven.centrepoint.model.plugin.ConfigurablePanel;
import com.effectivemaven.centrepoint.model.plugin.PluginManager;
import com.effectivemaven.centrepoint.store.ProjectStore;
import com.google.inject.Inject;

package com.effectivemaven.centrepoint.store.properties;

/**
 * Copyright 2009
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License. 
 */



public class PropertiesProjectStore
    implements ProjectStore
{
    /** The projects, cached in memory. */
    private Map<String, Project> projects = new LinkedHashMap<String, Project>();

    /** Where to save the projects on disk. */
    private String dataLocation;

    /** Logger. */
    private static Logger logger = Logger.getLogger( PropertiesProjectStore.class.getName() );

    /**
     * Configuration parameters that can be modified by alternate bindings in Guice.
     */
    static class RepositoryParams
    {
        @Inject( optional = true )
        private @DataLocation
        String dataLocation = System.getProperty( "user.home" ) + "/.centrepoint/";
    }

    @Inject
    private PropertiesProjectStore( RepositoryParams params, PluginManager pluginManager )