Enum ArchiveFormat

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<ArchiveFormat>

    public enum ArchiveFormat
    extends java.lang.Enum<ArchiveFormat>
    Denotes an archive format such as zip or tar.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      AR
      Constant used to identify the AR archive format.
      CPIO
      Constant used to identify the CPIO archive format.
      DUMP
      Constant used to identify the Unix DUMP archive format.
      JAR
      Constant used to identify the JAR archive format.
      SEVEN_Z
      Constant used to identify the 7z archive format.
      TAR
      Constant used to identify the TAR archive format.
      ZIP
      Constant used to identify the ZIP archive format.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static ArchiveFormat fromString​(java.lang.String archiveFormat)
      Attempts to return the ArchiveFormat instance from a possible given string representation.
      java.lang.String getDefaultFileExtension()
      Returns the default file extension for this compression type.
      java.lang.String getName()
      Returns the name by which the archive format is identified.
      static boolean isValidArchiveFormat​(java.lang.String archiveFormat)
      Checks if the given archive format name is valid and known format.
      static ArchiveFormat valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static ArchiveFormat[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • AR

        public static final ArchiveFormat AR
        Constant used to identify the AR archive format.
      • CPIO

        public static final ArchiveFormat CPIO
        Constant used to identify the CPIO archive format.
      • DUMP

        public static final ArchiveFormat DUMP
        Constant used to identify the Unix DUMP archive format.
      • JAR

        public static final ArchiveFormat JAR
        Constant used to identify the JAR archive format.
      • SEVEN_Z

        public static final ArchiveFormat SEVEN_Z
        Constant used to identify the 7z archive format.
      • TAR

        public static final ArchiveFormat TAR
        Constant used to identify the TAR archive format.
      • ZIP

        public static final ArchiveFormat ZIP
        Constant used to identify the ZIP archive format.
    • Method Detail

      • values

        public static ArchiveFormat[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ArchiveFormat c : ArchiveFormat.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ArchiveFormat valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getName

        public java.lang.String getName()
        Returns the name by which the archive format is identified.
        Returns:
        the archiver format name
      • getDefaultFileExtension

        public java.lang.String getDefaultFileExtension()
        Returns the default file extension for this compression type. E.g. ".gz" for gzip.
        Returns:
        the default file extension preceded by a dot
      • isValidArchiveFormat

        public static boolean isValidArchiveFormat​(java.lang.String archiveFormat)
        Checks if the given archive format name is valid and known format.
        Parameters:
        archiveFormat - the archive format name
        Returns:
        true if the given archive format is known to the factory, false otherwise
      • fromString

        public static ArchiveFormat fromString​(java.lang.String archiveFormat)
        Attempts to return the ArchiveFormat instance from a possible given string representation. Ignores case.
        Parameters:
        archiveFormat - string representation of the archive format. E.g. "tar" or "ZIP".
        Returns:
        the compression type enum
        Throws:
        java.lang.IllegalArgumentException - if the given archive format is unknown.