Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
idatt1002_2023_9
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
Andreas Kluge Svendsrud
idatt1002_2023_9
Commits
5ce58f06
Commit
5ce58f06
authored
1 year ago
by
Harry Linrui XU
Browse files
Options
Downloads
Patches
Plain Diff
Added method for clearing SelectedBudget.current file
parent
efb49169
No related branches found
No related tags found
1 merge request
!43
Merging frontend-testing into master
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/no/ntnu/idatt1002/demo/data/Budget/FileHandlingSelectedBudget.java
+11
-1
11 additions, 1 deletion
...datt1002/demo/data/Budget/FileHandlingSelectedBudget.java
with
11 additions
and
1 deletion
src/main/java/no/ntnu/idatt1002/demo/data/Budget/FileHandlingSelectedBudget.java
+
11
−
1
View file @
5ce58f06
...
...
@@ -22,7 +22,7 @@ public class FileHandlingSelectedBudget {
selectedBudgetFileType
)))
{
return
br
.
readLine
();
}
catch
(
IOException
ioException
)
{
throw
new
IOException
(
"File:
CurrentFile.tx
t does not exist"
,
ioException
);
throw
new
IOException
(
"File:
SelectedBudget.curren
t does not exist"
,
ioException
);
}
}
...
...
@@ -36,6 +36,16 @@ public class FileHandlingSelectedBudget {
}
}
public
static
void
clearSelectedBudget
()
throws
IOException
{
try
(
BufferedWriter
bw
=
new
BufferedWriter
(
new
FileWriter
(
filePath
+
"SelectedBudget"
+
selectedBudgetFileType
)))
{
bw
.
write
(
""
);
System
.
out
.
println
(
"Current file is: "
);
}
catch
(
IOException
ex
)
{
throw
new
IOException
(
"Error writing to file: "
+
"SelectedBudget.current"
);
}
}
public
static
boolean
isSelectedBudgetEmpty
(
String
fileTitle
)
throws
IOException
{
try
(
BufferedReader
br
=
new
BufferedReader
(
new
FileReader
(
filePath
+
"SelectedBudget"
+
selectedBudgetFileType
)))
{
...
...
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