Determine if a resource from the ServletContext is a file or directory
Given that we use the code below
Set paths = servletCtxt.getResourcePaths("/app/themes");

How can we tell if the path in paths is directory or a actual file?

This would usually be in an zipped war.

What I did find is this, but I am betting it isn't reliable:

When it is a file

    servletCtxt.getResource(dir).getContent()
        returned (java.io.ByteArrayInputStream) java.io.ByteArrayInputStream@5a645a64

When it is a directory it returned:
    
    (org.apache.naming.resources.FileDirContext) org.apache.naming.resources.FileDirContext@57155715

Is it safe to say that I could use a instanceof with InputStream on what is returned by getContent?

Thanks
Determine if a resource from the ServletContext is a file or directory
===

Given that we use the code below
Set paths = servletCtxt.getResourcePaths("/app/themes");

How can we tell if the path in paths is directory or a actual file?

This would usually be in an zipped war.

What I did find is this, but I am betting it isn't reliable:

When it is a file

    servletCtxt.getResource(dir).getContent()
        returned (java.io.ByteArrayInputStream) java.io.ByteArrayInputStream@5a645a64

When it is a directory it returned:
    
    (org.apache.naming.resources.FileDirContext) org.apache.naming.resources.FileDirContext@57155715

Is it safe to say that I could use a instanceof with InputStream on what is returned by getContent?

Thanks