Package io.microsphere.classloading
Class StreamArtifactResourceResolver
- java.lang.Object
-
- io.microsphere.classloading.AbstractArtifactResourceResolver
-
- io.microsphere.classloading.StreamArtifactResourceResolver
-
- All Implemented Interfaces:
ArtifactResourceResolver
,Prioritized
,java.lang.Comparable<Prioritized>
- Direct Known Subclasses:
ManifestArtifactResourceResolver
,MavenArtifactResourceResolver
public abstract class StreamArtifactResourceResolver extends AbstractArtifactResourceResolver
Abstract class ofArtifactResourceResolver
based on Stream- Since:
- 1.0.0
- Author:
- Mercy
- See Also:
ArtifactResourceResolver
,AbstractArtifactResourceResolver
-
-
Field Summary
-
Fields inherited from class io.microsphere.classloading.AbstractArtifactResourceResolver
classLoader, logger, priority
-
Fields inherited from interface io.microsphere.lang.Prioritized
COMPARATOR, MAX_PRIORITY, MIN_PRIORITY, NORMAL_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description StreamArtifactResourceResolver(int priority)
StreamArtifactResourceResolver(java.lang.ClassLoader classLoader, int priority)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.io.File
findArtifactMetadata(java.io.File directory)
protected java.util.jar.JarEntry
findArtifactMetadataEntry(java.util.jar.JarFile jarFile)
protected abstract boolean
isArtifactMetadata(java.lang.String relativePath)
protected boolean
isArtifactMetadataEntry(java.util.jar.JarEntry jarEntry)
protected boolean
isArtifactMetadataFile(java.io.File directory, java.io.File file)
protected java.io.InputStream
readArtifactMetadataDataFromArchiveFile(java.io.File archiveFile)
protected java.io.InputStream
readArtifactMetadataDataFromDirectory(java.io.File directory)
protected java.io.InputStream
readArtifactMetadataDataFromFile(java.io.File archiveFile)
protected java.io.InputStream
readArtifactMetadataDataFromResource(java.net.URL resourceURL, java.lang.ClassLoader classLoader)
Artifact
resolve(java.net.URL resourceURL)
Resolve an instanceArtifact
fromthe resource
of artifact.protected abstract Artifact
resolve(java.net.URL resourceURL, java.io.InputStream artifactMetadataData, java.lang.ClassLoader classLoader)
-
Methods inherited from class io.microsphere.classloading.AbstractArtifactResourceResolver
getPriority, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.microsphere.lang.Prioritized
compareTo
-
-
-
-
Method Detail
-
resolve
public final Artifact resolve(java.net.URL resourceURL)
Description copied from interface:ArtifactResourceResolver
Resolve an instanceArtifact
fromthe resource
of artifact.- Parameters:
resourceURL
-the resource
of artifact, it may the archive file or the directory- Returns:
- an instance
Artifact
if found, otherwisenull
-
readArtifactMetadataDataFromResource
@Nullable protected java.io.InputStream readArtifactMetadataDataFromResource(java.net.URL resourceURL, java.lang.ClassLoader classLoader) throws java.io.IOException
- Throws:
java.io.IOException
-
readArtifactMetadataDataFromArchiveFile
@Nullable protected java.io.InputStream readArtifactMetadataDataFromArchiveFile(java.io.File archiveFile) throws java.io.IOException
- Throws:
java.io.IOException
-
readArtifactMetadataDataFromFile
@Nullable protected java.io.InputStream readArtifactMetadataDataFromFile(java.io.File archiveFile) throws java.io.IOException
- Throws:
java.io.IOException
-
readArtifactMetadataDataFromDirectory
@Nullable protected java.io.InputStream readArtifactMetadataDataFromDirectory(java.io.File directory) throws java.io.IOException
- Throws:
java.io.IOException
-
findArtifactMetadataEntry
protected java.util.jar.JarEntry findArtifactMetadataEntry(java.util.jar.JarFile jarFile) throws java.io.IOException
- Throws:
java.io.IOException
-
findArtifactMetadata
protected java.io.File findArtifactMetadata(java.io.File directory) throws java.io.IOException
- Throws:
java.io.IOException
-
isArtifactMetadataEntry
protected boolean isArtifactMetadataEntry(java.util.jar.JarEntry jarEntry)
-
isArtifactMetadataFile
protected boolean isArtifactMetadataFile(java.io.File directory, java.io.File file)
-
isArtifactMetadata
protected abstract boolean isArtifactMetadata(java.lang.String relativePath)
-
resolve
protected abstract Artifact resolve(java.net.URL resourceURL, java.io.InputStream artifactMetadataData, java.lang.ClassLoader classLoader) throws java.io.IOException
- Throws:
java.io.IOException
-
-