ZosFileExtensionMappings
The ZosFileExtensionMappings object is a collection of all file extension mappings for a server. This object is obtained using the FileExtensions property of the ZosServer object.
ZosFileExtensionMappings Properties
ZosFileExtensionMappings exposes the following properties:
Property | Type | R/W | Description |
---|---|---|---|
[index] [name] | ZosFileExtensionMap ping | R | File extension mapping with specified index or data set name pattern. |
Count | Int32 | R | Number of objects in collection. |
Path | String | R | File system path name for collection. |
...
ZosFileExtensionMappings Methods
ZosFileExtensionMappings exposes the following methods:
Add Method
Adds a new file extension mapping. Index indicates position for new item. Specify –1 to insert at end. Returns index at which object has been added.
Overloads
Add(Int32, ZosFileExtensionMapping)
Int32 Add(Int32 index, ZosFileExtensionMapping mapping)
...
Add(Int32, String, String)
Int32 Add(Int32 index, String dsName, String fileExtension)
...
Find Method
Searches for mapping with specified name and returns reference to object. Returns null if name is not found.
ZosFileExtensionMapping Find(String name)
FindIndex Method
Searches for mapping with specified name and returns zero-based index. Returns -1 if name is not found.
Int32 FindIndex(String name)
FromArray Method
Copies the contents of a one-dimensional array into the collection. The existing contents of the collection are completely replaced.
void FromArray(ZosFileExtensionMapping[] array)
Move Method
Changes the order of file extension mappings.
Int32 Move(Int32 indexTo, Int32 indexFrom)
Refresh Method
Refreshes collection.
void Refresh()
Remove Method
Deletes a file extension, specified by data set name pattern. Returns true if item was removed or false if item is not found.
Boolean Remove(String name)
RemoveAt Method
Deletes a file extension, specified by index.
void RemoveAt(Int32 index)
ToArray Method
Copies the entire collection to a onedimensional array.
ZosFileExtensionMapping[] ToArray()
ZosFileExtensionMappings Examples
Examples of using ZosFileExtensionMappings are shown below:
C
ZosFileExtensionMappings mappings;
ZosFileExtensionMapping[] mappingArray = new ZosFileExtensionMapping[]
{
new ZosFileExtensionMapping("**.CNTL", "jcl"),
new ZosFileExtensionMapping("**.LIST", "txt")
};
mappings.FromArray(mappingArray);
mappings.Add(–1, "**.COBOL", "cbl");
mappings.Remove(“**.PARMLIB”);
mappings.Move(4,2);
...
C++
ZosFileExtensionMappings^ mappings;
array<ZosFileExtensionMapping>^ mappingArray =
{
new ZosFileExtensionMapping("**.CNTL", "jcl"),
new ZosFileExtensionMapping("**.LIST", "txt")
};
mappings.FromArray(mappingArray);
mappings->Add(–1, "**.COBOL", "cbl");
mappings->Remove(“**.PARMLIB”);
mappings->Move(4,2);
...
Visual Basic
Dim mappings As ZosFileExtensionMappings
Dim mappingArray() As ZosFileExtensionMapping = _
{ _
New ZosFileExtensionMapping("**.CNTL", "jcl"), _
New ZosFileExtensionMapping("**.LIST", "txt") _
} mappings.FromArray(mappingArray)
mappings.Add(–1, "**.COBOL", "cbl")
mappings.Remove(“**.PARMLIB”)
mappings.Move(4,2)
...
Jscript
var mappings : ZosFileExtensionMappings;
var mappingArray : ZosFileExtensionMapping[] =
[
new ZosFileExtensionMapping("**.CNTL", "jcl"),
new ZosFileExtensionMapping("**.LIST", "txt")
];
mappings.FromArray(mappingArray);
mappings.Add(–1, "**.COBOL", "cbl");
mappings.Remove(“**.PARMLIB”);
mappings.Move(4,2);
...