Hello, i am trying to do the thing as in title. I put image resource image in resource resource/com/module/name/image.png. It is on class path.
i do the:
assert (exists image = `module`.resourceByPath("image.png"));
I convert it to ceylon.URI
and then im stuck
I have tried using ImageIO to convert java.File into Image but it fils
value imageUri = URI(image.uri);
value file = File(imageUri.path);
file.setReadable(true);
value read = ImageIO.read(file);
It fails with
java.lang.RuntimeException: javax.imageio.IIOException: Can't read input file
Then i tried to use it as a ceylon.File readBytes and so on
but it fails on assertation
assert(is File file=parsePath(imageUri.path).resource.linkedResource);
It is Nill instance and not the ceylon.File.
i made a simple test if text file will be parsed from this location and it is.
assert (exists text= `module`.resourceByPath("test.txt"));
String textContent = text.textContent();
assert(textContent=="asdasdasdasdad");
How should i handle this ?