Fix for java.lang.UnsupportedOperationException: newFileChannel
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
This commit is contained in:
parent
a65a25e165
commit
8c7199c586
|
@ -1072,7 +1072,7 @@ public class BufferUtil
|
||||||
public static ByteBuffer toMappedBuffer(Resource resource) throws IOException
|
public static ByteBuffer toMappedBuffer(Resource resource) throws IOException
|
||||||
{
|
{
|
||||||
Path path = resource.getPath();
|
Path path = resource.getPath();
|
||||||
if (path == null)
|
if (path == null || !path.toUri().getScheme().endsWith("file"))
|
||||||
return null;
|
return null;
|
||||||
return toMappedBuffer(path);
|
return toMappedBuffer(path);
|
||||||
}
|
}
|
||||||
|
@ -1080,7 +1080,7 @@ public class BufferUtil
|
||||||
public static ByteBuffer toMappedBuffer(Resource resource, long pos, long len) throws IOException
|
public static ByteBuffer toMappedBuffer(Resource resource, long pos, long len) throws IOException
|
||||||
{
|
{
|
||||||
Path path = resource.getPath();
|
Path path = resource.getPath();
|
||||||
if (path == null)
|
if (path == null || !path.toUri().getScheme().endsWith("file"))
|
||||||
return null;
|
return null;
|
||||||
return toMappedBuffer(path, pos, len);
|
return toMappedBuffer(path, pos, len);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue