mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-12 23:07:15 -06:00
Native libraries: Fixed IllegalArgumentException: URI scheme is not "file" when using FlatLaf in WebStart. (issue #668; regression in FlatLaf 3.1)
This commit is contained in:
@@ -18,6 +18,7 @@ package com.formdev.flatlaf.ui;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URL;
|
||||
import java.security.CodeSource;
|
||||
import com.formdev.flatlaf.FlatSystemProperties;
|
||||
import com.formdev.flatlaf.util.LoggingFacade;
|
||||
import com.formdev.flatlaf.util.NativeLibrary;
|
||||
@@ -128,10 +129,15 @@ class FlatNativeLibrary
|
||||
private static File findLibraryBesideJar( String classifier, String ext ) {
|
||||
try {
|
||||
// get location of FlatLaf jar
|
||||
URL jarUrl = FlatNativeLibrary.class.getProtectionDomain().getCodeSource().getLocation();
|
||||
CodeSource codeSource = FlatNativeLibrary.class.getProtectionDomain().getCodeSource();
|
||||
URL jarUrl = (codeSource != null) ? codeSource.getLocation() : null;
|
||||
if( jarUrl == null )
|
||||
return null;
|
||||
|
||||
// if url is not a file, then we're running in a special environment (e.g. WebStart)
|
||||
if( !"file".equals( jarUrl.getProtocol() ) )
|
||||
return null;
|
||||
|
||||
File jarFile = new File( jarUrl.toURI() );
|
||||
|
||||
// if jarFile is a directory, then we're in a development environment
|
||||
|
||||
Reference in New Issue
Block a user