You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Romain Manni-Bucau (JIRA)" <ji...@apache.org> on 2014/05/20 11:58:39 UTC
[jira] [Created] (TOMEE-1217) toUrl in PerisstenceUnitInfoImpl can
create weird url when file is not a file but a jar link
Romain Manni-Bucau created TOMEE-1217:
-----------------------------------------
Summary: 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)