Library dependencies: System, SystemUI, Geometry, Display, Server, Output, GeoDatabase, GISClient
The DataSourcesFile library contains the implementation of the Geodatabase API for file-based data sources. These file-based data sources include; shapefile, coverage, TIN, CAD, SDC, StreetMap, and VPF.
The DataSourcesFile library is not extended by developers.
Workspace factory classes are the entry point for accessing data with the geodatabase objects for any data format. The type of workspace factory you instantiate dictates the type of data that can be handled by the workspace factory object and its derivatives.

Here are some values specific to ArcInfoWorkspaceFactory:
IWorkspaceFactory.getWorkspaceDescription returns "ARC/INFO Workspace".
IWorkspaceFactory.getWorkspaceType returns “0” or esriFileSystemWorkspace.
IWorkspaceFactory.isWorkspace returns True or False depending on whether or not there is an INFO™ subdirectory present.
IWorkspaceFactory.readconnectionPropertiesFromFile returns a PropertySet object, with the only property being DATABASE, which is set to the pathname.
The Workspace object is created by the ArcInfoWorkspaceFactory when the open or openFromFile methods are used. The class has interfaces with methods that include creating new ArcInfo coverages or INFO table data, renaming workspaces, and deleting ArcInfo coverages. Instances of this class can be created explicitly, but it should only be created by the workspace factory class.
IArcInfoWorkspace.createCoverage creates a new ArcInfo coverage in the workspace that is being referenced. The IFeatureDataset that is returned can be used to create new feature classes within the coverage. If a template coverage is not specified or the name is not a valid coverage, the new coverage will only have an empty .tic file. When a template coverage is used, the new coverage will have the same tics: bnd (boundary) and prj (projection). The precision enumerator esriCoveragePrecisionType is used to specify whether the coverage has single precision (7 significant digits for each coordinate) or double precision (15 significant digits for each coordinate). CreateCoverage will throw an exception if CoverageName is a path (such as “D:/data/canada”), if it is longer than 13 characters, or if it exists.
IArcInfoWorkspace.createInfoTable creates a new INFO table in the workspace that is being referenced. The ITable pointer that is returned can be used to add and delete items in the table. The name argument for the name of the new table can be up to 32 characters long, inclusive of the extension. The name cannot be an existing INFO table. The table will be created in the workspace used by the IArcInfoWorkspace; pathnames are recognized by this method. The ArcInfoItems object must be given, although it does not have to contain any items. If the ArcInfoItems contains items, they will be created in the new table.

The ICoverage interface provides information about coverages and processing operations specific to ArcInfo coverages. This interface can be used to create or update the topology of a coverage and set various tolerances that are used in coverage editing and processing. Tolerance values are considered to be verified if the specified tolerance value has actually been used to process the coverage, with the exception of the ArcEdit™ tolerances. EDIT, NODESNAP, WEED, GRAIN, and SNAP are verified as soon as they have been explicitly set.

The Table object is a collection of ArcInfo items (columns) and rows. All types of data use tables to store information about its features, but with ArcInfo the data is stored in an INFO table.
The IArcInfoTable interface is used to access and modify the items in the INFO table. With this interface, you can add or delete items, add or delete an index for an item, and change the properties of an item. This interface is used to get the items collection, with which you can get or set information for individual items.

A FeatureClass object is a collection of features that have the same feature type and set of attributes.
The ICoverageFeatureClass interface provides information on an individual feature class of an ArcInfo coverage.

The ArcInfoItems object represents the item set, or collection of items, in an INFO table. This object is similar to the Fields object used with tables from other data types. The ArcInfoItems object is an ordered collection of items, and the collection behaves like a list, so it is possible to access individual fields by a numbered position (or index) in the list. This class implements two interfaces. The IArcInfoItems interface is used to get the number of items, the index of an item, or an item object. The IArcInfoItemsEdit interface is used when creating or modifing an ArcInfoItems collection. For example, you can create a new ArcInfoItem object and add items to it, or you can get an item collection from an ArcInfo feature class and add or remove items from it.
An ArcInfoItem has many properties, the most obvious ones being its name and its data type. Use the IArcInfoItems interface to get the properties of an ArcInfo item. Use IArcInfoItemEdit to set the properties of an ArcInfo item. The esriItemType enumeration lists the possible data types for an ArcInfo item.

A CoverageName object identifies and locates a dataset object and supports methods to instantiate the actual named object. As noted in the section on name objects, a name object can be used as a lightweight surrogate of the actual object until further properties of the object are needed or additional methods on the object need to be called.
The CoverageName object can be used to retrieve information on the type of the coverage, what is contained in the coverage, and the metadata for the coverage. It can be used to find the coverage type, which is based on the highest level of dimension, for the feature classes contained. Levels of dimensions refer to how many dimensions are used to measure the features; in other words, a point has an x- and y-value; a line has length in addition to these values; and polygons, in addition, have area.

A CoverageFeatureClassName object identifies and locates a feature class in a coverage; it is used for obtaining some basic properties of the feature class without having to open (instantiate) it.
The ICoverageFeatureClassName interface has the same properties as the ICoverageFeatureClass interface, which is the get/setFeatureClassType if there is an attribute table, and the topology status.
The following sample illustrates the process of converting a coverage to a feature class in a personal geodatabase. The polygon features in a coverage called "states" are added to feature class in a newly created personal geodatabase called "states_con". The coverage dataset and the PGDB dataset are both passed to the FeatureDataConverter.convertFeatureDataset method.
PropertySet props = new PropertySet();
props.setProperty("Database","C:\\ArcGIS\\data\\usa");
AccessWorkspaceFactory awf = new AccessWorkspaceFactory();
WorkspaceName outWSName = new WorkspaceName(awf.create("C:\\Program Files\\ArcGIS\\java\\samples\\data\\usa","usa_con",props,0));
FeatureDatasetName dsn = new FeatureDatasetName();
dsn.setWorkspaceNameByRef(outWSName);
dsn.setName("states_con");
WorkspaceName inWSName = new WorkspaceName();
inWSName.setPathName("C:\\arcgis\\ArcTutor\\Catalog\\Yellowstone");
inWSName.setWorkspaceFactoryProgID("esriDataSourcesFile.ArcInfoWorkspaceFactory.1");
FeatureDatasetName dsn2 = new FeatureDatasetName();
dsn2.setName("states");
dsn2.setWorkspaceNameByRef(inWSName);
FeatureDataConverter converter = new FeatureDataConverter();
converter.convertFeatureDataset(dsn2,dsn,null,"",1000,0);
The following example demonstrates how to use ArcObjects to coverage features into a shapefile:
ArcInfoWorkspaceFactory workspaceFactory = new ArcInfoWorkspaceFactory();
Workspace workspace = new Workspace(workspaceFactory.openFromFile("C:\\arcgis\\ArcTutor\\Catalog\\Yellowstone", 0));
// Identify the coverage and feature class to be converted
IFeatureClass featClass = workspace.openFeatureClass("states:polygon");
IDataset dataset = new IDatasetProxy(featClass);
IName name = dataset.getFullName();
IFeatureClassName covFeatClassName = (IFeatureClassName) name;
// Open the workspace that will contain the new shapefile of
// converted coverage features
WorkspaceName shapeWorkName = new WorkspaceName();
shapeWorkName.setWorkspaceFactoryProgID("esriDataSourcesFile.ShapefileWorkspaceFactory");
shapeWorkName.setPathName("C:\\arcgis\\ArcTutor\\Catalog\\Yellowstone");
// Specify the name of the shapefile
FeatureClassName shapeFeatClassName = new FeatureClassName();
IDatasetName dataSetName = (IDatasetName) shapeFeatClassName;
dataSetName.setName("states_converted");
dataSetName.setWorkspaceNameByRef(shapeWorkName);
// Now, convert the coverage features into shapefile features
FeatureDataConverter featDataConv = new FeatureDataConverter();
featDataConv.convertFeatureClass(covFeatClassName, null, null, shapeFeatClassName, null, null, null, 1000, 0);
The ICadDrawingWorkspace interface on the Workspace object is used to open a CAD dataset. From the ICadDrawingDataset that is returned, you can retrieve CAD specific information about the dataset such as its path, if it’s from AutoCad, or if it’s a dgn file.
The StreetMap objects allow you to build routes between locations. There are objects to define the final and intermediate stops of the route, objects for adjusting parameters of search, routing task solver object, as well as objects that provide details on the result path geometry and driving directions.
The first step is to create the factory of solver objects using the SMRouterFactory. Call ISMRouterFactory.createRouter() passing in the path to your routing data to create an SMRouter object and return an ISMRouter.
In order to find a route, it is necessary to create an SMPointsCollection object and add your stops into this collection. This object is passed to ISMRouter.solve which builds the route and returns an ISMDirections that contains resulting path geometry and driving directions texts.
It is possible to control how the route is built using several ISMRoute interface members.
The following sample demonstrates how to use the StreetMap object library to create a simple route between to points from a StreetMap data source:
SMRouterFactory factory = new SMRouterFactory();
// Get the StreetMap router from the StreetMap routing service data source
ISMRouter router = factory.createRouter("C:\\arcgis\\ArcTutor\\StreetMap\\streets.rs");
router.getPreferences().setItem(esriSMRoadType.esriSMRoadTypeHighways,Short.parseShort("75"));
router.setNetAttributeName("Time");
// Create a collection of stops
ISMStopsCollection collection = new SMStopsCollection();
// Define the departure stop point...
ISMRouterPoint pt1 = new SMRouterPoint();
pt1.setX(-87.124);
pt1.setY(33.447);
// Create a flag from the first point...
ISMFlag flag1 = router.getFlagCreator().createFlag(pt1);
// Create the stop and add the stop info
ISMStop stop1 = new SMStop();
stop1.setFlag(flag1);
stop1.setDescription("Departure Point");
stop1.setDuration(Short.parseShort("0"));
stop1.setStopID(1000);
// Define the arrival stop point...
ISMRouterPoint pt2 = new SMRouterPoint();
pt2.setX(-86.953);
pt2.setY(33.428);
// Create a flag for the second point...
ISMFlag flag2 = router.getFlagCreator().createFlag(pt2);
// Create the arrival stop and add the stop info...
ISMStop stop2 = new SMStop();
stop2.setFlag(flag2);
stop2.setDescription("Arrival Point");
stop2.setDuration(Short.parseShort("0"));
stop2.setStopID(1001);
// Add the stops to the collection
collection.add(stop1);
collection.add(stop2);
// Finally, solve the route
ISMDirections directions = router.solve(collection, null);
System.out.println(directions.getTotalsText());
This next example is almost identical to the previous one, but in this program, barriers are added to the route before it is solved.
// Create the workspace factory for the StreetMap data source
SMRouterFactory factory = new SMRouterFactory();
// Get the StreetMap router from the StreetMap routing service data source
ISMRouter router = factory.createRouter("C:\\arcgis\\ArcTutor\\StreetMap\\streets.rs");
router.getPreferences().setItem(esriSMRoadType.esriSMRoadTypeHighways,Short.parseShort("75"));
router.setNetAttributeName("Time");
// Create a collection of stops
ISMStopsCollection collection = new SMStopsCollection();
// Define the departure stop point...
ISMRouterPoint pt1 = new SMRouterPoint();
pt1.setX(-87.124);
pt1.setY(33.447);
// Create a flag from the first point...
ISMFlag flag1 = router.getFlagCreator().createFlag(pt1);
// Create the stop and add the stop info
ISMStop stop1 = new SMStop();
stop1.setFlag(flag1);
stop1.setDescription("Departure Point");
stop1.setDuration(Short.parseShort("0"));
stop1.setStopID(1000);
// Define the arrival stop point...
ISMRouterPoint pt2 = new SMRouterPoint();
pt2.setX(-86.953);
pt2.setY(33.428);
// Create a flag for the second point...
ISMFlag flag2 = router.getFlagCreator().createFlag(pt2);
// Create the arrival stop and add the stop info...
ISMStop stop2 = new SMStop();
stop2.setFlag(flag2);
stop2.setDescription("Arrival Point");
stop2.setDuration(Short.parseShort("0"));
stop2.setStopID(1001);
// Add the stops to the collection
collection.add(stop1);
collection.add(stop2);
// Add a Barrier...
ISMNetBarriersCollection bcol = router.getBarriers();
ISMRouterPoint bPoint = new SMRouterPoint();
ISMNetBarrier barrier = new SMNetBarrier();
bPoint.setX(-87.103);
bPoint.setY(33.457);
barrier.setBarrierID(1200);
barrier.setPoint(bPoint);
bcol.add(barrier);
// Finally, solve the route
ISMDirections directions = router.solve(collection, null);
System.out.println(directions.getTotalsText());