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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadjustJarFileEntryUrl
(URL url, URL rootUrl) Adjust the given URL, if needed.Build a descriptor of the archive indicated by the given urlbuildArchiveDescriptor
(URL url, String entry) Build a descriptor of the archive indicated by the path relative to the given urlprotected String
extractLocalFilePath
(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 Details
-
INSTANCE
Singleton access
-
-
Constructor Details
-
StandardArchiveDescriptorFactory
public StandardArchiveDescriptorFactory()
-
-
Method Details
-
buildArchiveDescriptor
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
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
-
extractLocalFilePath
-
getJarURLFromURLEntry
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
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.
-