public class ArchiveNioSupports
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static ArchiveNioSupport |
combined()
Get an
ArchiveNioSupport that combines all known instances. |
static java.nio.file.Path |
skipRootSameName(java.nio.file.Path root,
java.lang.String name)
If root contains a folder with the same name as
name , and no regular files,
returns the path to that folder. |
static java.util.Optional<ArchiveDir> |
tryOpenAsDir(java.nio.file.Path archive) |
public static java.util.Optional<ArchiveDir> tryOpenAsDir(java.nio.file.Path archive) throws java.io.IOException
java.io.IOException
public static ArchiveNioSupport combined()
ArchiveNioSupport
that combines all known instances.ArchiveNioSupport
instancepublic static java.nio.file.Path skipRootSameName(java.nio.file.Path root, java.lang.String name) throws java.io.IOException
name
, and no regular files,
returns the path to that folder. Otherwise, return the root path.
This method is used to provide equal outputs for archives that do and do not contain their name as part of their root folder.
root
- the root pathname
- the name that might exist inside rootjava.io.IOException