Class StandardArchiveDescriptorFactory
- java.lang.Object
-
- org.hibernate.boot.archive.internal.StandardArchiveDescriptorFactory
-
- All Implemented Interfaces:
ArchiveDescriptorFactory
,JarFileEntryUrlAdjuster
public class StandardArchiveDescriptorFactory extends Object implements ArchiveDescriptorFactory, JarFileEntryUrlAdjuster
Standard implementation of ArchiveDescriptorFactory
-
-
Field Summary
Fields Modifier and Type Field Description static StandardArchiveDescriptorFactory
INSTANCE
Singleton access
-
Constructor Summary
Constructors Constructor Description StandardArchiveDescriptorFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description URL
adjustJarFileEntryUrl(URL url, URL rootUrl)
Adjust the given URL, if needed.ArchiveDescriptor
buildArchiveDescriptor(URL url)
Build a descriptor of the archive indicated by the given urlArchiveDescriptor
buildArchiveDescriptor(URL url, String entry)
Build a descriptor of the archive indicated by the path relative to the given urlprotected String
extractLocalFilePath(URL url)
URL
getJarURLFromURLEntry(URL url, String entry)
Given a URL which defines an entry within a JAR (really any "bundled archive" such as a jar file, zip, etc) and an entry within that JAR, find the URL to the JAR itself.
-
-
-
Field Detail
-
INSTANCE
public static final StandardArchiveDescriptorFactory INSTANCE
Singleton access
-
-
Method Detail
-
buildArchiveDescriptor
public ArchiveDescriptor buildArchiveDescriptor(URL url)
Description copied from interface:ArchiveDescriptorFactory
Build a descriptor of the archive indicated by the given url- Specified by:
buildArchiveDescriptor
in interfaceArchiveDescriptorFactory
- Parameters:
url
- The url to the archive- Returns:
- The descriptor
-
buildArchiveDescriptor
public ArchiveDescriptor buildArchiveDescriptor(URL url, String entry)
Description copied from interface:ArchiveDescriptorFactory
Build a descriptor of the archive indicated by the path relative to the given url- Specified by:
buildArchiveDescriptor
in interfaceArchiveDescriptorFactory
- Parameters:
url
- The url to the archiveentry
- The path within the given url that refers to the archive- Returns:
- The descriptor
-
getJarURLFromURLEntry
public URL getJarURLFromURLEntry(URL url, String entry) throws IllegalArgumentException
Description copied from interface:ArchiveDescriptorFactory
Given a URL which defines an entry within a JAR (really any "bundled archive" such as a jar file, zip, etc) and an entry within that JAR, find the URL to the JAR itself.- Specified by:
getJarURLFromURLEntry
in interfaceArchiveDescriptorFactory
- Parameters:
url
- The URL to an entry within a JARentry
- The entry that described the thing referred to by the URL relative to the JAR- Returns:
- The URL to the JAR
- Throws:
IllegalArgumentException
- Generally indicates a problem with malformed urls.
-
adjustJarFileEntryUrl
public URL adjustJarFileEntryUrl(URL url, URL rootUrl)
Description copied from interface:JarFileEntryUrlAdjuster
Adjust the given URL, if needed.- Specified by:
adjustJarFileEntryUrl
in interfaceJarFileEntryUrlAdjuster
- Parameters:
url
- The url to adjustrootUrl
- The root URL, for resolving relative URLs- Returns:
- The adjusted url.
-
-