* Issue #8999 - Remove FileID.isArchive() from ResourceFactory * Remove FileID.isArchive() from URIUtil.toJarFileUri
This commit is contained in:
parent
fab644151a
commit
95fd8adeb8
|
@ -1862,9 +1862,6 @@ public final class URIUtil
|
|||
Objects.requireNonNull(uri, "URI");
|
||||
String scheme = Objects.requireNonNull(uri.getScheme(), "URI scheme");
|
||||
|
||||
if (!FileID.isArchive(uri))
|
||||
return uri;
|
||||
|
||||
boolean hasInternalReference = uri.getRawSchemeSpecificPart().indexOf("!/") > 0;
|
||||
|
||||
if (scheme.equalsIgnoreCase("jar"))
|
||||
|
@ -1882,6 +1879,8 @@ public final class URIUtil
|
|||
else if (scheme.equalsIgnoreCase("file"))
|
||||
{
|
||||
String rawUri = uri.toASCIIString();
|
||||
if (rawUri.endsWith("/")) // skip directories
|
||||
return uri;
|
||||
if (hasInternalReference)
|
||||
return URI.create("jar:" + rawUri);
|
||||
else
|
||||
|
|
|
@ -20,7 +20,6 @@ import java.nio.file.Path;
|
|||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.eclipse.jetty.util.FileID;
|
||||
import org.eclipse.jetty.util.Loader;
|
||||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.eclipse.jetty.util.URIUtil;
|
||||
|
@ -237,8 +236,6 @@ public interface ResourceFactory
|
|||
|
||||
default Resource newJarFileResource(URI uri)
|
||||
{
|
||||
if (!FileID.isArchive(uri))
|
||||
throw new IllegalArgumentException("Path is not a Java Archive: " + uri);
|
||||
if (!uri.getScheme().equalsIgnoreCase("file"))
|
||||
throw new IllegalArgumentException("Not an allowed path: " + uri);
|
||||
return newResource(URIUtil.toJarFileUri(uri));
|
||||
|
|
Loading…
Reference in New Issue