Closed ComLock closed 1 week ago
Maybe
final URL url = resource.getUrl();
if ( url == null )
{
return false;
}
try
{
if ( Files.isDirectory( Path.of( url.toURI() ) ) )
{
return true;
}
return false;
}
catch ( URISyntaxException e )
{
return false;
}
isDirectory must be carefully implemented. Existing methods of IOService can't tell the difference between 0 size file and non-existent file
https://github.com/enonic/lib-static/blob/9720787ba73057d7ae89377f962895e0566d57d2/src/main/java/lib/enonic/libStatic/IoService.java#L146
According to @rymsha we can assume that is a resource has size 0 it's a directory.
However when I run some tests, it seems Enonic doesn't know the difference between a non-existant folder and an actual one.