throw IllegalArgumentException if container resource is not readable
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
parent
4b0f45f121
commit
9a9d8fb6ea
|
@ -25,6 +25,7 @@ import java.util.Objects;
|
|||
import jakarta.servlet.ServletContext;
|
||||
import org.eclipse.jetty.util.URIUtil;
|
||||
import org.eclipse.jetty.util.resource.Resource;
|
||||
import org.eclipse.jetty.util.resource.Resources;
|
||||
import org.eclipse.jetty.util.thread.AutoLock;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -714,7 +715,9 @@ public class MetaData
|
|||
|
||||
public void addContainerResource(Resource jar)
|
||||
{
|
||||
Objects.requireNonNull(jar);
|
||||
if (!Resources.isReadable(jar))
|
||||
throw new IllegalArgumentException("Resource is not readable: " + jar);
|
||||
|
||||
if (!_orderedContainerResources.contains(jar))
|
||||
_orderedContainerResources.add(jar);
|
||||
else
|
||||
|
|
|
@ -25,6 +25,7 @@ import java.util.Objects;
|
|||
import jakarta.servlet.ServletContext;
|
||||
import org.eclipse.jetty.util.URIUtil;
|
||||
import org.eclipse.jetty.util.resource.Resource;
|
||||
import org.eclipse.jetty.util.resource.Resources;
|
||||
import org.eclipse.jetty.util.thread.AutoLock;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -714,7 +715,9 @@ public class MetaData
|
|||
|
||||
public void addContainerResource(Resource jar)
|
||||
{
|
||||
Objects.requireNonNull(jar);
|
||||
if (!Resources.isReadable(jar))
|
||||
throw new IllegalArgumentException("Resource is not readable: " + jar);
|
||||
|
||||
if (!_orderedContainerResources.contains(jar))
|
||||
_orderedContainerResources.add(jar);
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue