You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by angelochen <an...@yahoo.com.hk> on 2012/01/13 15:40:37 UTC

reading an asset into a string

is this possible?

  @Inject @Path("context:/js/init.photoswipe.js")
    private Asset myEffects;

--
View this message in context: http://tapestry.1045711.n5.nabble.com/reading-an-asset-into-a-string-tp5142710p5142710.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: reading an asset into a string

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Fri, 13 Jan 2012 21:28:06 -0200, angelochen  
<an...@yahoo.com.hk> wrote:

> Hi Thiago,

Hi!

> String s = myEffects.toString()
> it does not read the content of the file, but the name of the asset.

The JavaDoc of this method doesn't say it reads the content of the file.  
You'll need to read the InputStream provided by  
Asset.getResource.openStream().

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: reading an asset into a string

Posted by angelochen <an...@yahoo.com.hk>.
Hi Thiago,

String s = myEffects.toString()

it does not read the content of the file, but the name of the asset.


Thiago H de Paula Figueiredo wrote
> 
> On Fri, 13 Jan 2012 12:40:37 -0200, angelochen  
> &lt;angelochen960@.com&gt; wrote:
> 
>> is this possible?
>>
>>   @Inject @Path("context:/js/init.photoswipe.js")
>>     private Asset myEffects;
> 
> Yes, but what's the relation of the code above with the subject of your  
> message? Haven't you tried the code above before posting in the mailing  
> list? ;)
> 
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
> and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@.apache
> For additional commands, e-mail: users-help@.apache
> 


--
View this message in context: http://tapestry.1045711.n5.nabble.com/reading-an-asset-into-a-string-tp5142710p5144020.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: reading an asset into a string

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Fri, 13 Jan 2012 12:40:37 -0200, angelochen  
<an...@yahoo.com.hk> wrote:

> is this possible?
>
>   @Inject @Path("context:/js/init.photoswipe.js")
>     private Asset myEffects;

Yes, but what's the relation of the code above with the subject of your  
message? Haven't you tried the code above before posting in the mailing  
list? ;)

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: reading an asset into a string

Posted by Dusko Jovanovski <du...@gmail.com>.
It's here: http://tapestry.apache.org/assets.html#Assets-InjectingAssets

On Fri, Jan 13, 2012 at 4:01 PM, angelochen <an...@yahoo.com.hk>wrote:

> hi,
> i checked that link, but can't find info.
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/reading-an-asset-into-a-string-tp5142710p5142757.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: reading an asset into a string

Posted by angelochen <an...@yahoo.com.hk>.
hi,
i checked that link, but can't find info.

--
View this message in context: http://tapestry.1045711.n5.nabble.com/reading-an-asset-into-a-string-tp5142710p5142757.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: reading an asset into a string

Posted by Dusko Jovanovski <du...@gmail.com>.
Yes, see http://tapestry.apache.org/assets.html

On Fri, Jan 13, 2012 at 3:40 PM, angelochen <an...@yahoo.com.hk>wrote:

> is this possible?
>
>  @Inject @Path("context:/js/init.photoswipe.js")
>    private Asset myEffects;
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/reading-an-asset-into-a-string-tp5142710p5142710.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>