Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BigDataViewer_Core_Extension
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
BioinformaticDataCompression
BigDataViewer_Core_Extension
Commits
b312da82
Commit
b312da82
authored
8 years ago
by
Tobias Pietzsch
Browse files
Options
Downloads
Patches
Plain Diff
look for bigdataviewer.properties in current directory and ~/.bdv/
parent
71704d75
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/bdv/util/Prefs.java
+26
-16
26 additions, 16 deletions
src/main/java/bdv/util/Prefs.java
with
26 additions
and
16 deletions
src/main/java/bdv/util/Prefs.java
+
26
−
16
View file @
b312da82
...
...
@@ -122,27 +122,37 @@ public class Prefs
private
static
Prefs
readPropertyFile
()
{
final
File
file
=
new
File
(
"bigdataviewer.properties"
);
return
readPropertyFile
(
file
);
}
private
static
Prefs
readPropertyFile
(
final
File
file
)
{
try
// try "bdvkeyconfig.yaml" in current directory
// then "~/.bdv/bdvkeyconfig.yaml"
final
File
[]
files
=
new
File
[]
{
new
File
(
"bigdataviewer.properties"
),
new
File
(
System
.
getProperty
(
"user.home"
)
+
"/.bdv/bigdataviewer.properties"
)
};
for
(
final
File
file
:
files
)
{
final
InputStream
stream
=
new
FileInputStream
(
file
);
final
Properties
config
=
new
Properties
();
config
.
load
(
stream
);
return
new
Prefs
(
config
);
}
catch
(
final
IOException
e
)
{
System
.
out
.
println
(
"Cannot find the config file :"
+
file
+
". Using default settings."
);
System
.
out
.
println
(
e
.
getMessage
()
);
if
(
file
.
isFile
()
)
{
try
{
return
readPropertyFile
(
file
);
}
catch
(
final
IOException
e
)
{
System
.
err
.
println
(
"Cannot read config file :"
+
file
);
e
.
printStackTrace
();
}
}
}
return
new
Prefs
(
null
);
}
private
static
Prefs
readPropertyFile
(
final
File
file
)
throws
IOException
{
final
InputStream
stream
=
new
FileInputStream
(
file
);
final
Properties
config
=
new
Properties
();
config
.
load
(
stream
);
return
new
Prefs
(
config
);
}
public
static
Properties
getDefaultProperties
()
{
final
Properties
properties
=
new
Properties
();
...
...
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