DecompressInputArgument Method

Decompresses the file specified by a method's input argument into the temporary directory.

Class:TemporaryDirectory
Intended use:Intended for GeoEco internal use only; not recommended for external callers
COM:Not exposed by a COM class
ArcGIS:Not exposed as an ArcGIS geoprocessing tool
Method type:Instance Method

Usage

decompressedFile = tempDir.DecompressInputArgument(argName)

Arguments

argName
Python type:unicode
Minimum length:1

Name an input argument that may be a compressed file.

The calling method must pass in the name of one of its arguments. Do not pass in the path of the compressed file. The ArgumentMetadata.Type for the argument must be an instance of GeoEco.Types.FileTypeMetadata, and CanBeCompressed must be True. DecompressInputArgument() obtains the value of the argument (the path of the compressed file) from the local variables of the calling method's stack frame.

For a usage example, see BinaryRaster.SwapBytes().

Returns

decompressedFile
Python type:unicode
Minimum length:1
Maximum length:255
Must exist:No

Path of the decompressed file.

If the path provided to the calling function for the named argument is a path to a file that is not compressed, it will be returned.

If it is a path to a compressed file that is not an archive (i.e. only one file is compressed within it), the compressed file will be extracted to a subdirectory in the temporary directory, and the path to the decompressed file will be returned.

If the compressed file is an archive, the return value is the path to the decompressed file specified by the DecompressedFileToUse property of the GeoEco.Types.FileTypeMetadata metadata for the named argument.

Remarks

This method is part of the internal implementation of GeoEco and is not intended to be used by external callers.

DecompressInputArgument() is intended to be called from methods that allow their callers to pass in the path of a compressed file as an input argument. If the passed-in path is a compressed file, DecompressInputArgument() will decompress it to the temporary directory and return the path of the decompressed file. If the passed-in path is not a compressed file, DecompressInputArgument() will return the passed-in path.

For a usage example, see BinaryRaster.SwapBytes().