Resources

53 views
Skip to first unread message

Stephane Epardaud

unread,
Apr 3, 2015, 4:16:44 AM4/3/15
to ceylon-dev
It's not clear to me that I can use our resources API for packing files and extracting them. I want to write a Ceylon API plugin which lets me do scaffolding, so I'd like to pack some template projects in my .car and extract some of them at runtime to a folder on the user's machine. Since we pack resources in the .car, we can only get its URL (which I assume is a JVM-specific URL with jar://....car!/contents-within-car/... which I can't use from the Ceylon SDK) or a text contents (which does not work with binary), so I don't quite see how I can use resources for that.

Am I missing anything or are we missing something? Ideally I'd be able to get a FileSystem view of my resources using ceylon.file, no? Then I could use ceylon.io to read the files and stuff.

--
Stéphane Épardaud

Gavin King

unread,
Apr 3, 2015, 6:05:57 AM4/3/15
to ceylo...@googlegroups.com
Right, it does not yet really support binary resources. Only text
resources. That's because there is no binaryContent() operation yet.
> --
> You received this message because you are subscribed to the Google Groups
> "ceylon-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ceylon-dev+...@googlegroups.com.
> To post to this group, send email to ceylo...@googlegroups.com.
> Visit this group at http://groups.google.com/group/ceylon-dev.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ceylon-dev/CAKU9E9thgDZ_Ga%2BUa_rHi--LC06uMrdzZgMzgGoQQ6oKd3CaGA%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.



--
Gavin King
ga...@ceylon-lang.org
http://profiles.google.com/gavin.king
http://ceylon-lang.org
http://hibernate.org
http://seamframework.org

Stephane Epardaud

unread,
Apr 3, 2015, 8:08:16 AM4/3/15
to ceylon-dev
Sure, but if we extend ceylon.file to be able to "mount" our Module then we can access every resource as a file system and handle binary there, using ceylon.io.


For more options, visit https://groups.google.com/d/optout.



--
Stéphane Épardaud

Stephane Epardaud

unread,
Apr 3, 2015, 8:08:48 AM4/3/15
to ceylon-dev
I think that'd be a nice solution to the problem of resources we've been having.
--
Stéphane Épardaud
Reply all
Reply to author
Forward
0 new messages