Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BraillePlot
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Georg Graßnick
BraillePlot
Commits
d25f025c
Commit
d25f025c
authored
5 years ago
by
Georg Graßnick
Browse files
Options
Downloads
Patches
Plain Diff
Fix loadJarFile() for paths containing spaces
parent
b15fb375
No related branches found
Branches containing commit
No related tags found
1 merge request
!36
Bug/file path issues
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/de/tudresden/inf/mci/brailleplot/util/GeneralResource.java
+4
-1
4 additions, 1 deletion
...e/tudresden/inf/mci/brailleplot/util/GeneralResource.java
with
4 additions
and
1 deletion
src/main/java/de/tudresden/inf/mci/brailleplot/util/GeneralResource.java
+
4
−
1
View file @
d25f025c
...
@@ -9,6 +9,7 @@ import java.io.FileNotFoundException;
...
@@ -9,6 +9,7 @@ import java.io.FileNotFoundException;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.net.URL
;
import
java.net.URL
;
import
java.net.URLDecoder
;
import
java.nio.file.Files
;
import
java.nio.file.Files
;
import
java.nio.file.Path
;
import
java.nio.file.Path
;
import
java.nio.file.StandardCopyOption
;
import
java.nio.file.StandardCopyOption
;
...
@@ -188,7 +189,9 @@ public final class GeneralResource {
...
@@ -188,7 +189,9 @@ public final class GeneralResource {
if
(!
isRunFromCompiledJar
())
{
if
(!
isRunFromCompiledJar
())
{
throw
new
IllegalStateException
(
"Not running from jar."
);
throw
new
IllegalStateException
(
"Not running from jar."
);
}
}
File
jarFile
=
new
File
(
getClassRef
().
getProtectionDomain
().
getCodeSource
().
getLocation
().
getPath
());
URL
jarUrl
=
getClassRef
().
getProtectionDomain
().
getCodeSource
().
getLocation
();
String
jarPath
=
URLDecoder
.
decode
(
jarUrl
.
getPath
(),
"UTF-8"
);
File
jarFile
=
new
File
(
jarPath
);
return
new
JarFile
(
jarFile
);
return
new
JarFile
(
jarFile
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"Error while retrieving JarFile reference."
,
e
);
throw
new
RuntimeException
(
"Error while retrieving JarFile reference."
,
e
);
...
...
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