Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BudgetMaster
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
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
Robert Goldmann
BudgetMaster
Commits
933bb339
Commit
933bb339
authored
8 years ago
by
Robert Goldmann
Browse files
Options
Downloads
Patches
Plain Diff
Fixed wrong encoding of settings.json, Fixed export
parent
625b9f46
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!58
merge new_database_structure into master
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.classpath
+1
-1
1 addition, 1 deletion
.classpath
src/de/deadlocker8/budgetmaster/logic/Budget.java
+6
-0
6 additions, 0 deletions
src/de/deadlocker8/budgetmaster/logic/Budget.java
src/de/deadlocker8/budgetmaster/logic/Utils.java
+9
-4
9 additions, 4 deletions
src/de/deadlocker8/budgetmaster/logic/Utils.java
with
16 additions
and
5 deletions
.classpath
+
1
−
1
View file @
933bb339
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry
including=
"**/*.java"
kind=
"src"
output=
"target/classes"
path=
"src"
>
<classpathentry
kind=
"src"
output=
"target/classes"
path=
"src"
>
<attributes>
<attribute
name=
"optional"
value=
"true"
/>
<attribute
name=
"maven.pomderived"
value=
"true"
/>
...
...
This diff is collapsed.
Click to expand it.
src/de/deadlocker8/budgetmaster/logic/Budget.java
+
6
−
0
View file @
933bb339
...
...
@@ -37,4 +37,10 @@ public class Budget
{
return
paymentSum
;
}
@Override
public
String
toString
()
{
return
"Budget [incomeSum="
+
incomeSum
+
", paymentSum="
+
paymentSum
+
"]"
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/de/deadlocker8/budgetmaster/logic/Utils.java
+
9
−
4
View file @
933bb339
...
...
@@ -2,6 +2,9 @@ package de.deadlocker8.budgetmaster.logic;
import
java.io.File
;
import
java.io.IOException
;
import
java.io.Reader
;
import
java.io.Writer
;
import
java.nio.charset.Charset
;
import
java.nio.file.Files
;
import
java.nio.file.Paths
;
import
java.util.Locale
;
...
...
@@ -17,14 +20,14 @@ public class Utils
public
static
Settings
loadSettings
()
{
String
settingsJSON
;
Settings
settings
;
try
{
Gson
gson
=
new
Gson
();
PathUtils
.
checkFolder
(
new
File
(
PathUtils
.
getOSindependentPath
()
+
bundle
.
getString
(
"folder"
)));
settingsJSON
=
new
String
(
Files
.
readAllBytes
(
Paths
.
get
(
PathUtils
.
getOSindependentPath
()
+
bundle
.
getString
(
"folder"
)
+
"/settings.json"
)));
settings
=
gson
.
fromJson
(
settingsJSON
,
Settings
.
class
);
Reader
reader
=
Files
.
newBufferedReader
(
Paths
.
get
(
PathUtils
.
getOSindependentPath
()
+
bundle
.
getString
(
"folder"
)
+
"/settings.json"
),
Charset
.
forName
(
"UTF-8"
));
settings
=
gson
.
fromJson
(
reader
,
Settings
.
class
);
reader
.
close
();
return
settings
;
}
catch
(
IOException
e
)
...
...
@@ -38,6 +41,8 @@ public class Utils
Gson
gson
=
new
Gson
();
String
jsonString
=
gson
.
toJson
(
settings
);
Files
.
write
(
Paths
.
get
(
PathUtils
.
getOSindependentPath
()
+
bundle
.
getString
(
"folder"
)
+
"/settings.json"
),
jsonString
.
getBytes
());
Writer
writer
=
Files
.
newBufferedWriter
(
Paths
.
get
(
PathUtils
.
getOSindependentPath
()
+
bundle
.
getString
(
"folder"
)
+
"/settings.json"
),
Charset
.
forName
(
"UTF-8"
));
writer
.
write
(
jsonString
);
writer
.
close
();
}
}
\ No newline at end of file
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