-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8f65a74
commit 976412c
Showing
5 changed files
with
39 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 0 additions & 59 deletions
59
src/main/java/io/github/burakkaygusuz/utils/ConfigurationUtil.java
This file was deleted.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
src/main/java/io/github/burakkaygusuz/utils/PropertyUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package io.github.burakkaygusuz.utils; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.util.Properties; | ||
|
||
public class PropertyUtil { | ||
|
||
private static volatile PropertyUtil instance = null; | ||
private final Properties properties; | ||
|
||
private PropertyUtil(String fileName) { | ||
this.properties = new Properties(); | ||
try (InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(fileName)) { | ||
properties.load(inputStream); | ||
} catch (IOException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
|
||
public static PropertyUtil getInstance(String fileName) { | ||
if (instance == null) { | ||
synchronized (PropertyUtil.class) { | ||
if (instance == null) | ||
instance = new PropertyUtil(fileName); | ||
} | ||
} | ||
return instance; | ||
} | ||
|
||
public String getProperty(String key) { | ||
return properties.getProperty(key); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters