Class ArchiveNioSupports

java.lang.Object
com.sk89q.worldedit.util.io.file.ArchiveNioSupports

public class ArchiveNioSupports extends Object
  • Method Details

    • tryOpenAsDir

      public static Optional<ArchiveDir> tryOpenAsDir(Path archive) throws IOException
      Throws:
      IOException
    • combined

      public static ArchiveNioSupport combined()
      Get an ArchiveNioSupport that combines all known instances.
      Returns:
      a combined ArchiveNioSupport instance
    • skipRootSameName

      public static Path skipRootSameName(Path root, String name) throws IOException
      If root contains a folder with the same name as 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.

      Parameters:
      root - the root path
      name - the name that might exist inside root
      Returns:
      the corrected path
      Throws:
      IOException