Package com.facebook.buck.util.unarchive
Enum ArchiveFormat
- java.lang.Object
-
- java.lang.Enum<ArchiveFormat>
-
- com.facebook.buck.util.unarchive.ArchiveFormat
-
- All Implemented Interfaces:
Serializable
,Comparable<ArchiveFormat>
public enum ArchiveFormat extends Enum<ArchiveFormat>
A collection different archive types, and the unarchiver that should be used to extract archives
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getExtension()
Get the extension (including '.') for this archive typestatic com.google.common.collect.ImmutableList<String>
getFileExtensions()
Get all available file extensionsstatic Optional<ArchiveFormat>
getFormatFromFilename(String filename)
Gets the archive format based on a filestatic Optional<ArchiveFormat>
getFormatFromShortName(String shortName)
Gets the archive format based on a short nameString
getShortName()
Get the short name for the archive typestatic com.google.common.collect.ImmutableList<String>
getShortNames()
Get all available short namesUnarchiver
getUnarchiver()
Get the unarchiver used to extract archives of this typeString
toString()
static ArchiveFormat
valueOf(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.
-
-
-
Enum Constant Detail
-
TAR
public static final ArchiveFormat TAR
-
TAR_BZ2
public static final ArchiveFormat TAR_BZ2
-
TAR_GZ
public static final ArchiveFormat TAR_GZ
-
TAR_XZ
public static final ArchiveFormat TAR_XZ
-
TAR_ZSTD
public static final ArchiveFormat TAR_ZSTD
-
ZIP
public static final ArchiveFormat ZIP
-
-
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(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:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getFormatFromFilename
public static Optional<ArchiveFormat> getFormatFromFilename(String filename)
Gets the archive format based on a file- Parameters:
filename
- The filename to try to use- Returns:
- The archive format, or empty if no matching format could be found
-
getFormatFromShortName
public static Optional<ArchiveFormat> getFormatFromShortName(String shortName)
Gets the archive format based on a short name- Parameters:
shortName
- The short name used in build files- Returns:
- The archive format, or empty if no matching format could be found
-
getUnarchiver
public Unarchiver getUnarchiver()
Get the unarchiver used to extract archives of this type
-
getExtension
public String getExtension()
Get the extension (including '.') for this archive type
-
getShortName
public String getShortName()
Get the short name for the archive type
-
toString
public String toString()
- Overrides:
toString
in classEnum<ArchiveFormat>
-
getShortNames
public static com.google.common.collect.ImmutableList<String> getShortNames()
Get all available short names
-
getFileExtensions
public static com.google.common.collect.ImmutableList<String> getFileExtensions()
Get all available file extensions
-
-