Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Bricked
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Robert Goldmann
Bricked
Commits
3df14d2d
Commit
3df14d2d
authored
8 years ago
by
Max Wittig
Browse files
Options
Downloads
Patches
Plain Diff
catch malformated url
parent
ced54c61
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/de/bricked/utils/Downloader.java
+17
-3
17 additions, 3 deletions
src/de/bricked/utils/Downloader.java
src/de/bricked/utils/FileUtils.java
+1
-1
1 addition, 1 deletion
src/de/bricked/utils/FileUtils.java
with
18 additions
and
4 deletions
src/de/bricked/utils/Downloader.java
+
17
−
3
View file @
3df14d2d
...
...
@@ -4,6 +4,9 @@ package de.bricked.utils;
import
de.bricked.game.Config
;
import
de.bricked.game.levels.LevelPack
;
import
de.bricked.game.levels.LevelPackParser
;
import
logger.LogLevel
;
import
logger.Logger
;
import
java.io.FileWriter
;
public
class
Downloader
...
...
@@ -15,10 +18,21 @@ public class Downloader
public
void
download
(
String
url
)
{
downloadedString
=
FileUtils
.
getURLContent
(
url
);
if
(
downloadedString
!=
null
)
{
try
{
levelPackParser
=
new
LevelPackParser
(
downloadedString
);
levelPack
=
levelPackParser
.
getLevelPack
();
save
();
}
catch
(
Exception
e
)
{
Logger
.
log
(
LogLevel
.
ERROR
,
Logger
.
exceptionToString
(
e
));
}
}
}
private
void
save
()
{
...
...
This diff is collapsed.
Click to expand it.
src/de/bricked/utils/FileUtils.java
+
1
−
1
View file @
3df14d2d
...
...
@@ -53,7 +53,7 @@ public class FileUtils
}
catch
(
Exception
e
)
{
e
.
printStackTrace
(
);
Logger
.
log
(
LogLevel
.
ERROR
,
Logger
.
exceptionToString
(
e
)
);
}
return
null
;
}
...
...
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