类 ArchiveHelper
- java.lang.Object
-
- org.hibernate.boot.archive.internal.ArchiveHelper
-
public class ArchiveHelper extends Object
Helper for dealing with archives- 作者:
- Emmanuel Bernard, Steve Ebersole
-
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static byte[]getBytesFromInputStream(InputStream inputStream)Extracts the bytes out of an InputStream.static byte[]getBytesFromInputStreamSafely(InputStream inputStream)Extracts the bytes out of an InputStream.static URLgetJarURLFromURLEntry(URL url, String entry)Get the JAR URL of the JAR containing the given entry Method used in a non managed environmentstatic URLgetURLFromPath(String jarPath)get the URL from a given path string
-
-
-
方法详细资料
-
getJarURLFromURLEntry
public static URL getJarURLFromURLEntry(URL url, String entry) throws IllegalArgumentException
Get the JAR URL of the JAR containing the given entry Method used in a non managed environment- 参数:
url- URL pointing to the known file in the JARentry- file known to be in the JAR- 返回:
- the JAR URL
- 抛出:
IllegalArgumentException- if none URL is found
-
getURLFromPath
public static URL getURLFromPath(String jarPath)
get the URL from a given path string- 参数:
jarPath- The path that represents a URL- 返回:
- The resolved URL reference
- 抛出:
IllegalArgumentException- if something goes wrong
-
getBytesFromInputStreamSafely
public static byte[] getBytesFromInputStreamSafely(InputStream inputStream) throws ArchiveException
Extracts the bytes out of an InputStream. This form is the same asgetBytesFromInputStream(java.io.InputStream)except that anyIOExceptionis wrapped as (runtime)ArchiveException- 参数:
inputStream- The stream from which to extract bytes.- 返回:
- The bytes
- 抛出:
ArchiveException- Indicates a problem accessing the stream
-
getBytesFromInputStream
public static byte[] getBytesFromInputStream(InputStream inputStream) throws IOException
Extracts the bytes out of an InputStream.- 参数:
inputStream- The stream from which to extract bytes.- 返回:
- The bytes
- 抛出:
IOException- Indicates a problem accessing the stream- 另请参阅:
getBytesFromInputStreamSafely(java.io.InputStream)
-
-