You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Jean-Louis MONTEIRO (JIRA)" <ji...@apache.org> on 2014/05/20 13:26:38 UTC
[jira] [Resolved] (TOMEE-1217) toUrl in PerisstenceUnitInfoImpl can
create weird url when file is not a file but a jar link
[ https://issues.apache.org/jira/browse/TOMEE-1217?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jean-Louis MONTEIRO resolved TOMEE-1217.
----------------------------------------
Resolution: Fixed
> toUrl in PerisstenceUnitInfoImpl can create weird url when file is not a file but a jar link
> --------------------------------------------------------------------------------------------
>
> Key: TOMEE-1217
> URL: https://issues.apache.org/jira/browse/TOMEE-1217
> Project: TomEE
> Issue Type: Bug
> Reporter: Romain Manni-Bucau
> Assignee: Romain Manni-Bucau
> Fix For: 1.7.0
>
>
> Index: src/main/java/org/apache/openejb/persistence/PersistenceUnitInfoImpl.java
> ===================================================================
> --- src/main/java/org/apache/openejb/persistence/PersistenceUnitInfoImpl.java (revision 1596160)
> +++ src/main/java/org/apache/openejb/persistence/PersistenceUnitInfoImpl.java (working copy)
> @@ -250,6 +250,13 @@
> }
>
> private URL toUrl(final File root) throws MalformedURLException {
> + if (!root.isFile() && root.getPath().startsWith("jar:file:")) {
> + try {
> + return new URL(root.getPath());
> + } catch (final MalformedURLException me) {
> + // no-op: keep previous behavior
> + }
> + }
> return root.toURI().toURL();
> }
>
--
This message was sent by Atlassian JIRA
(v6.2#6252)