Skip to content

Commit 7c761d9

Browse files
committed
Changed aPi
1 parent 4adae54 commit 7c761d9

File tree

4 files changed

+65
-3
lines changed

4 files changed

+65
-3
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ dependencies {
2424
testImplementation 'junit:junit:4.12'
2525

2626
// https://mvnrepository.com/artifact/org.springframework.hateoas/spring-hateoas
27-
compile 'org.springframework.hateoas:spring-hateoas:0.24.0.RELEASE'
27+
compileOnly 'org.springframework.hateoas:spring-hateoas:0.24.0.RELEASE'
2828

2929
// PersistenceWS Stubs
3030
compileOnly 'com.github.java-game-server:stubs:0.6.2'

src/main/java/com/apporelbotna/gameserver/persistencewsclient/DAO.java renamed to src/main/java/com/apporelbotna/gameserver/persistencewsclient/GameDAO.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
//esto se podria hacer alguna clase que controlase los codigos que se mostraran en la applicacion
2020
//personalizados y en diferentes idiomas
2121

22-
public class DAO
22+
public class GameDAO
2323
{
2424
public static final String SERVER_URL = "http://localhost:8082/";
2525
RestTemplate restTemplate = new RestTemplate();
2626

27-
public DAO()
27+
public GameDAO()
2828
{
2929

3030
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
package com.apporelbotna.gameserver.persistencewsclient.properties;
2+
3+
import java.io.FileInputStream;
4+
import java.io.IOException;
5+
import java.util.Properties;
6+
7+
import org.slf4j.Logger;
8+
import org.slf4j.LoggerFactory;
9+
10+
public final class ApplicationProperties
11+
{
12+
private static final Logger logger = LoggerFactory.getLogger(ApplicationProperties.class);
13+
14+
private static String version;
15+
private static String name;
16+
17+
private static String serverUrl;
18+
19+
private ApplicationProperties()
20+
{
21+
throw new UnsupportedOperationException("ApplicationProperties must not be instantiated!");
22+
}
23+
24+
static
25+
{
26+
String rootPath = Thread.currentThread().getContextClassLoader().getResource("").getPath();
27+
String applicationPropertiesPath = rootPath + "com\\apporelbotna\\gameserver\\persistencewsclient\\properties\\application.properties";
28+
29+
Properties applicationProperties = new Properties();
30+
try
31+
{
32+
applicationProperties.load(new FileInputStream(applicationPropertiesPath));
33+
version = applicationProperties.getProperty("version");
34+
name = applicationProperties.getProperty("name");
35+
36+
serverUrl = applicationProperties.getProperty("server.url");
37+
}
38+
catch (IOException e)
39+
{
40+
logger.error(e.getMessage());
41+
}
42+
}
43+
44+
public static String getVersion()
45+
{
46+
return version;
47+
}
48+
49+
public static String getName()
50+
{
51+
return name;
52+
}
53+
54+
public static String getServerUrl()
55+
{
56+
return serverUrl;
57+
}
58+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
version=2.0.0
2+
name=PersistenceWSClient
3+
4+
server.url=http\://localhost\:8082/

0 commit comments

Comments
 (0)