You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Nomer Nominus <ta...@outlook.com> on 2013/05/11 02:15:27 UTC
How to check wheter File exists or not
I need to check wheter File can be readable or not, however I don't know how to implement it in Tapestry app. If I put inside my method
public String getPath() {
File file = new File(article);
if (article.canRead() || article.isFile()){
return something
}
return something
}
I get following Unable to instantiate instance of transformed class [thatClass] java.lang.reflect.InvocationTargetException. How to avoid this issue!?
Re: How to check wheter File exists or not
Posted by Muhammad Gelbana <m....@gmail.com>.
I think you've put your service class in a tapestry transformable package
(pages, mixins, components, more ?)
In your web.xml, you specify your main application package, beneath that
package there could be (4 or 5 ?) types of special package names (tapestry
coding through convention ?):
1. Base
2. Pages
3. Components
4. Mixins
5. Services
I may have added an extra 's' or something, a quick start project should
demonstrate the packages I mean. I'm writing this because I couldn't google
the documentation page having this already written !
On Sat, May 11, 2013 at 2:21 AM, Taha Hafeez Siddiqi <
tawus.tapestry@gmail.com> wrote:
> Hi
>
> On 11-May-2013, at 5:45 AM, Nomer Nominus <ta...@outlook.com> wrote:
>
> > I need to check wheter File can be readable or not, however I don't know
> how to implement it in Tapestry app.
>
> Just as you would implement it in plain java.
>
> > If I put inside my method
> >
> > public String getPath() {
> > File file = new File(article);
> > if (article.canRead() || article.isFile()){
> > return something
> > }
> > return something
> > }
> >
> > I get following Unable to instantiate instance of transformed class
> [thatClass] java.lang.reflect.InvocationTargetException. How to avoid this
> issue!?
> >
>
> I don't think this error is related to the above code. Can you share some
> code and the full error stacktrace?
>
> regards
> Taha
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
Re: How to check wheter File exists or not
Posted by Taha Hafeez Siddiqi <ta...@gmail.com>.
Hi
On 11-May-2013, at 5:45 AM, Nomer Nominus <ta...@outlook.com> wrote:
> I need to check wheter File can be readable or not, however I don't know how to implement it in Tapestry app.
Just as you would implement it in plain java.
> If I put inside my method
>
> public String getPath() {
> File file = new File(article);
> if (article.canRead() || article.isFile()){
> return something
> }
> return something
> }
>
> I get following Unable to instantiate instance of transformed class [thatClass] java.lang.reflect.InvocationTargetException. How to avoid this issue!?
>
I don't think this error is related to the above code. Can you share some code and the full error stacktrace?
regards
Taha
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org