/*
 * $Id: DataStoreFactory.java,v 1.4 2004/06/27 17:28:26 marbobo Exp $
 *
 * Copyright (c) Siemens AG 2008 
 *           (c) Universität Paderborn 2008 
 * Licensed under EUPL 1.1. 
 *
 * $Log: DataStoreFactory.java,v $
 * Revision 1.4  2004/06/27 17:28:26  marbobo
 * + Quellcode maintenance
 *
 * Revision 1.3  2004/03/12 12:56:59  bigmac
 * Anpassungen an VKCKeywordSerializer und VKCDynaAttributeSerializer
 * und generelle Refactorings durchgeführt
 *
 * Revision 1.2  2003/11/14 15:37:16  jonyp
 * *** empty log message ***
 *
 * Revision 1.1  2002/10/21 14:36:14  bigmac
 * *** empty log message ***
 *
 * Revision 1.1  2002/04/29 14:43:40  koppy
 * initial revision
 *
 *
 */

package vkc.server.archive;


public final class DataStoreFactory 
{

    /**
     * Liefert anhand der url den entsprechenden DataStore
     *
     * @param   url - URL fuer den DataStore
     * @author koppy
     */
	 
    public static final DataStore getDataStoreByUrl( String url ) 
	throws DataStoreException  {

	if( url == null )
	    throw new DataStoreException( "DataStore-URL not specified yet!" );
		
	url = url.trim();
			
	if( url.startsWith( "file" ) )
	    return new FileDataStore( url );

    throw new DataStoreException( "DataStore-URL should" 
					  + " start with \"file\" or  \"jdbc\"" );
    }
    
}
