Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
de.ugoe.cs.rwm.mocci
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rwm
de.ugoe.cs.rwm.mocci
Commits
fa006126
Commit
fa006126
authored
4 years ago
by
erbel
Browse files
Options
Downloads
Patches
Plain Diff
Add properties helper
parent
bd4cb996
No related branches found
No related tags found
No related merge requests found
Pipeline
#159364
canceled
4 years ago
Stage: build
Stage: test
Stage: pages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/util/PropertiesHelper.java
+61
-0
61 additions, 0 deletions
...de/ugoe/cs/rwm/mocci/connector/util/PropertiesHelper.java
with
61 additions
and
0 deletions
de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/util/PropertiesHelper.java
0 → 100644
+
61
−
0
View file @
fa006126
/**
* Copyright (c) 2018-2019 University of Goettingen
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* - Johannes Erbel <johannes.erbel@cs.uni-goettingen.de>
*/
package
de.ugoe.cs.rwm.mocci.connector.util
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.Properties
;
public
final
class
PropertiesHelper
{
Properties
props
;
private
final
static
String
FILENAME
=
"mocci.properties"
;
public
PropertiesHelper
()
{
loadProperties
();
}
/**
* Getter method for providing the properties of this ResultProviderHelper.
* Properties will be read from local file resultprovider.properties.
*
* @return The properties
*/
public
Properties
getProperties
()
{
if
(
props
==
null
)
{
loadProperties
();
}
return
props
;
}
private
void
loadProperties
()
{
props
=
new
Properties
();
InputStream
input
=
null
;
try
{
input
=
this
.
getClass
().
getClassLoader
().
getResourceAsStream
(
FILENAME
);
props
.
load
(
input
);
}
catch
(
IOException
ex
)
{
ex
.
printStackTrace
();
}
finally
{
if
(
input
!=
null
)
{
try
{
input
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment