ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.Data Namespace / FileSystemConnectionPath Class / FileSystemConnectionPath Constructor
A valid path to a specific file-system data store.
The type of file-system data store.
Example

In This Topic
    FileSystemConnectionPath Constructor
    In This Topic
    Opens a file-system data store with the specified path.
    Syntax
    Public Function New( _
       ByVal path As Uri, _
       ByVal type As FileSystemDatastoreType _
    )
    public FileSystemConnectionPath( 
       Uri path,
       FileSystemDatastoreType type
    )

    Parameters

    path
    A valid path to a specific file-system data store.
    type
    The type of file-system data store.
    Exceptions
    ExceptionDescription
    No valid file-system data store has been opened prior to invoking this operation.
    path is null.
    type is invalid.
    Example
    Opening a FeatureClass from a ShapeFile Datastore
    {
      await QueuedTask.Run(() =>
      {
        FileSystemConnectionPath fileConnection = new FileSystemConnectionPath(new Uri("path\\to\\folder\\containing\\shapefiles"),
            FileSystemDatastoreType.Shapefile);
        using (FileSystemDatastore shapefile = new FileSystemDatastore(fileConnection))
        {
          FeatureClass taxLotsFeatureClass = shapefile.OpenDataset<FeatureClass>("TaxLots");
    
          // Can use the .shp extension, but its not needed.
          FeatureClass manHolesFeatureClass = shapefile.OpenDataset<FeatureClass>("ManHoles.shp");
    
          Table taxDetailsTableWithoutExtension = shapefile.OpenDataset<Table>("TaxDetails");
          Table taxDetailsTable = shapefile.OpenDataset<Table>("TaxDetails.dbf");
        }
      });
    }
    Opening a CAD Datastore
    {
      await QueuedTask.Run(() =>
      {
        FileSystemConnectionPath fileConnection = new FileSystemConnectionPath(new Uri("path\\to\\folder\\containing\\CAD"), FileSystemDatastoreType.Cad);
        using (FileSystemDatastore cadDatastore = new FileSystemDatastore(fileConnection))
        {
          //Note: Extension is required
          FeatureClass cadDataset = cadDatastore.OpenDataset<FeatureClass>("hatchplayboundaries.dwg");
    
          // Take note of the pattern for referencing a feature class. 
          FeatureClass cadfeatureClass = cadDatastore.OpenDataset<FeatureClass>("hatchplayboundaries.dwg:Polyline");
    
          int numRows = 0;
          using (RowCursor cursor = cadfeatureClass.Search())
          {
            while (cursor.MoveNext())
              numRows++;
          }
        }
      });
    }
    Open raster dataset in a folder
    // Create a FileSystemConnectionPath using the folder path.
    FileSystemConnectionPath connectionPath = new(new System.Uri(@"C:\Temp"), FileSystemDatastoreType.Raster);
    // Create a new FileSystemDatastore using the FileSystemConnectionPath.
    FileSystemDatastore dataStore = new(connectionPath);
    // Open the raster dataset.
    RasterDataset fileRasterDataset = dataStore.OpenDataset<RasterDataset>("Sample.tif");
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also