You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by "A.J. (JIRA)" <ji...@apache.org> on 2010/08/09 15:14:16 UTC

[jira] Commented: (PIVOT-591) add a readObject(File) method to WTKXSerializer

    [ https://issues.apache.org/jira/browse/PIVOT-591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12896533#action_12896533 ] 

A.J. commented on PIVOT-591:
----------------------------

ok, but in practice, most people new to pivot (like me) will be tempted to use a pattern like this : new WTKXSerializer(new FileInputStream(file)).
(Especially when your're trying to load external wtkx files (not on classpath))
This works ... until your wtkx file do include another wtkx in which case you have a runtime exception (MalformedURLException).
So, it would be great to discourage the use of the readObject(InputSream) method (from a public api perspective) since it is used mainly by the framework, in favor of readObject(String resourceName) or readObject(URL location)
 
does it make sense ?

> add a readObject(File) method to WTKXSerializer
> -----------------------------------------------
>
>                 Key: PIVOT-591
>                 URL: https://issues.apache.org/jira/browse/PIVOT-591
>             Project: Pivot
>          Issue Type: Improvement
>          Components: wtk
>    Affects Versions: 1.5
>         Environment: mac os x 10.6
>            Reporter: A.J.
>            Priority: Trivial
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> When loadind a WTKX file using WTKXSerializer readObject(InputStream) method, the serializer fails to load included WTKX because its location is not set.
> Adding a method readObject(File file) such as this one should fix this issue : 
>     public Object readObject(File file) throws IOException, SerializationException {
>     	return readObject(file.toURI().toURL());
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.