Skip to content

Commit

Permalink
Merge pull request #18 from jenkinsci/fixWhenPathWithSpaces
Browse files Browse the repository at this point in the history
Fix UnsatisfiedLinkError when path to plugin contains spaces.
  • Loading branch information
olivierdagenais committed Oct 25, 2013
2 parents bd21c0d + f4e33a2 commit 333515c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/main/java/hudson/plugins/tfs/model/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.io.IOException;
import java.io.Reader;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.security.CodeSource;
import java.security.ProtectionDomain;
Expand Down Expand Up @@ -67,7 +68,15 @@ static synchronized void ensureNativeLibrariesConfigured() {
final CodeSource codeSource = protectionDomain.getCodeSource();
// TODO: codeSource could be null; what should we do, then?
final URL location = codeSource.getLocation();
final String stringPathToJar = location.getFile();
URI locationUri = null;
try {
locationUri = location.toURI();
} catch (URISyntaxException e) {
// this shouldn't happen
// TODO: consider logging this situation if it ever happens
return;
}
final String stringPathToJar = locationUri.getPath();
final File pathToJar = new File(stringPathToJar);
final File pathToLibFolder = pathToJar.getParentFile();
final File pathToNativeFolder = new File(pathToLibFolder, "native");
Expand Down

0 comments on commit 333515c

Please sign in to comment.