public class MultiReleaseJarFile
extends java.lang.Object
implements java.io.Closeable
Utility class to handle a Multi Release Jar file
Modifier and Type | Class and Description |
---|---|
class |
MultiReleaseJarFile.VersionedJarEntry
A versioned Jar entry
|
Constructor and Description |
---|
MultiReleaseJarFile(java.io.File file)
Construct a multi release jar file for the current JVM version, ignoring directories.
|
MultiReleaseJarFile(java.io.File file,
int javaPlatform,
boolean includeDirectories)
Construct a multi release jar file
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
MultiReleaseJarFile.VersionedJarEntry |
getEntry(java.lang.String name)
Get a versioned resource entry by name
|
int |
getVersion() |
boolean |
isMultiRelease() |
java.util.stream.Stream<MultiReleaseJarFile.VersionedJarEntry> |
stream() |
java.lang.String |
toString() |
public MultiReleaseJarFile(java.io.File file) throws java.io.IOException
file
- The file to openjava.io.IOException
- if the jar file cannot be readpublic MultiReleaseJarFile(java.io.File file, int javaPlatform, boolean includeDirectories) throws java.io.IOException
file
- The file to openjavaPlatform
- The JVM platform to apply when selecting a version.includeDirectories
- true if any directory entries should not be ignoredjava.io.IOException
- if the jar file cannot be readpublic boolean isMultiRelease()
public int getVersion()
public java.util.stream.Stream<MultiReleaseJarFile.VersionedJarEntry> stream()
public MultiReleaseJarFile.VersionedJarEntry getEntry(java.lang.String name)
name
- The unversioned name of the resourcepublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 1995–2023 Webtide. All rights reserved.