Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
JThequeDataSource |
|
| 1.0;1 |
1 | package org.jtheque.core.managers.persistence; | |
2 | ||
3 | import org.jtheque.core.managers.Managers; | |
4 | import org.springframework.jdbc.datasource.SingleConnectionDataSource; | |
5 | ||
6 | /* | |
7 | * This file is part of JTheque. | |
8 | * | |
9 | * JTheque is free software: you can redistribute it and/or modify | |
10 | * it under the terms of the GNU General Public License as published by | |
11 | * the Free Software Foundation, either version 3 of the License. | |
12 | * | |
13 | * JTheque is distributed in the hope that it will be useful, | |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | * GNU General Public License for more details. | |
17 | * | |
18 | * You should have received a copy of the GNU General Public License | |
19 | * along with JTheque. If not, see <http://www.gnu.org/licenses/>. | |
20 | */ | |
21 | ||
22 | /** | |
23 | * This class is a simple data source who place the database to the current folder specified | |
24 | * in the application. | |
25 | * | |
26 | * @author Baptiste Wicht | |
27 | */ | |
28 | 0 | public final class JThequeDataSource extends SingleConnectionDataSource { |
29 | @Override | |
30 | public void setUrl(String s) { | |
31 | 0 | String url = s.replace("{current}", Managers.getCore().getApplication().getFolderPath()); |
32 | ||
33 | 0 | super.setUrl(url); |
34 | 0 | } |
35 | } |