com.esri.arcgis.system
Interface IFileNames2

All Superinterfaces:
Serializable
All Known Implementing Classes:
FileNames

public interface IFileNames2
extends Serializable

Provides access to retrieve subsets based on extension.

Description

The IFileNames2 interface provides advanced file-specific array methods.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux


Method Summary
 boolean find(String fileName)
          Advances the current postion to the specified file if it exists.
 String getContainedExtensions()
          Returns a delimited set of extensions contained within the collection.
 IFileNames getSubset(String extSet)
          Returns a subset based on a delimited set of extensions.
 void loadFromPath(String path)
          Loads the collection with files from the specified path.
 

Method Detail

loadFromPath

void loadFromPath(String path)
                  throws IOException,
                         AutomationException
Loads the collection with files from the specified path.

Description

The LoadFromPath method adds any file names to the array (both directories and files) that are found in the specified directory path.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
path - The path (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSubset

IFileNames getSubset(String extSet)
                     throws IOException,
                            AutomationException
Returns a subset based on a delimited set of extensions.

Description

The GetSubset method returns a FileNames object consisting of a subset of the file names in the array that have the specified extension.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
extSet - The extSet (in)
Returns:
A reference to a com.esri.arcgis.system.IFileNames
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getContainedExtensions

String getContainedExtensions()
                              throws IOException,
                                     AutomationException
Returns a delimited set of extensions contained within the collection.

Description

The GetContainedExtensions method returns a delimited string containing the file name extensions within the array. For example, "txt|shp".

If the array contains a file name which is a directory, "<dir>" is returned. For example, "txt|<dir>|shp". Use the IFileNames::IsDirectory method to determine if a file name is a directory or a file.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The extSet
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

find

boolean find(String fileName)
             throws IOException,
                    AutomationException
Advances the current postion to the specified file if it exists.

Description

Indicates whether the specified file name exists in the array.

Remarks

If the array contains a file name which is a directory path, the Find method returns False (not found) if the directory path was passed to be searched. The Find method searches only for files.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
fileName - The fileName (in)
Returns:
The pFound
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.