|
|||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
UpdateFactory.java | - | 0% | 0% | 0% |
|
1 |
/*
|
|
2 |
|
|
3 |
VRMoo Server - Virtual Reality Object Oriented MUD Server
|
|
4 |
Copyright (C) 2001 - 2003 VRMoo Development Team
|
|
5 |
|
|
6 |
|
|
7 |
This program is free software; you can redistribute it and/or modify
|
|
8 |
it under the terms of the GNU General Public License as published by
|
|
9 |
the Free Software Foundation; either version 2 of the License, or
|
|
10 |
(at your option) any later version.
|
|
11 |
|
|
12 |
This program is distributed in the hope that it will be useful,
|
|
13 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15 |
GNU General Public License for more details.
|
|
16 |
|
|
17 |
You should have received a copy of the GNU General Public License
|
|
18 |
along with this program; if not, write to the Free Software
|
|
19 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
20 |
|
|
21 |
|
|
22 |
For information about VRMoo and its authors, please visit the website:
|
|
23 |
http://www.vrmoo.org/
|
|
24 |
|
|
25 |
*/
|
|
26 |
|
|
27 |
package org.vrmoo.server.data.update;
|
|
28 |
|
|
29 |
import org.vrmoo.common.exception.VRMooException;
|
|
30 |
|
|
31 |
/**
|
|
32 |
* Produce an <code>Update</code> class for updating the VRMoo Server data
|
|
33 |
* directory based upon the version of the data directory.
|
|
34 |
*
|
|
35 |
* @author Jeff Weston
|
|
36 |
*/
|
|
37 |
public class UpdateFactory |
|
38 |
{ |
|
39 |
/**
|
|
40 |
* This class is not meant to be instantiated, so make the constructor
|
|
41 |
* private.
|
|
42 |
*/
|
|
43 | 0 |
private UpdateFactory( )
|
44 |
{ |
|
45 |
} |
|
46 |
|
|
47 |
/**
|
|
48 |
* Construct an <code>Update</code> class for updating the specified version
|
|
49 |
* of the VRMoo Server data directory.
|
|
50 |
*
|
|
51 |
* @param version the version of the VRMoo server data directory
|
|
52 |
*
|
|
53 |
* @return an <code>Update</code> class for updating the data directory
|
|
54 |
*
|
|
55 |
* @throws VRMooException if there is no update class for the specified
|
|
56 |
* version
|
|
57 |
*/
|
|
58 | 0 |
public static Update createUpdate( int version ) |
59 |
throws VRMooException
|
|
60 |
{ |
|
61 | 0 |
switch ( version )
|
62 |
{ |
|
63 | 0 |
case 1 : return new Version1Update( ); |
64 | 0 |
case 2 : return new Version2Update( ); |
65 | 0 |
default : throw new VRMooException( "Unable to update." ); |
66 |
} |
|
67 |
} |
|
68 |
} |
|
69 |
|
|