public class

Geodatabase

extends Object
java.lang.Object
   ↳ com.esri.core.geodatabase.Geodatabase

Class Overview

The Geodatabase class is for opening and accessing the contents of a geodatabase file.

A geodatabase file is typically an offline copy of data from an ArcGIS service, although they can be created using ArcMap. The geodatabase will contain a number of GeodatabaseFeatureTables. The tables will contain attribute data and for spatial features it also stores the rendering information. A GeodatabaseFeatureTable can be used to create a FeatureLayer which will display the features on a map.

When you are done with a Geodatabase instance, such as on application exit, call its dispose() method. This will release resources used by the Geodatabase.

Use the GeodatabaseSyncTask class to generate a geodatabase from a sync-enabled ArcGIS service, and to sync the geodatabase back with the service.

See also:

Summary

Public Constructors
Geodatabase(String path)
Instantiates a Geodatabase object by opening a geodatabase file (.geodatabase).
Geodatabase(String path, boolean useAdvancedSymbology)
Instantiates a Geodatabase object by opening a local geodatabase (.geodatabase file).
Public Methods
void acknowledgeUpload(SyncGeodatabaseParameters syncParameters)
For internal use only
void createClientDelta(String path)
For internal use only
void dispose()
Disposes the geodatabase.
boolean equals(Object obj)
GeodatabaseFeatureTable getGeodatabaseFeatureTableByLayerId(int layer)
Retrieves a table using its service layer ID.
List<GeodatabaseFeatureTable> getGeodatabaseTables()
Gets a list of tables contained in the geodatabase
long getHandle()
For internal use only
String getPath()
Returns the location of the .geodatabase file
GenerateGeodatabaseParameters getRegisterParameters()
Returns the parameters which were used to create the geodatabase initially.
String getServiceURL()
Returns the URL of service from which the geodatabase was created.
SyncModel getSyncModel()
Returns the synchronisation model which the geodatabase has been set up to use.
SyncGeodatabaseParameters getSyncParameters()
Query synchronization parameters from the geodatabase.
boolean hasLocalEdits()
Checks for local edits.
int hashCode()
boolean isSyncEnabled()
Indicates whether this geodatabase was originally downloaded from a sync-enabled ArcGIS feature service.
void reRegister(String geodatabaseId, String userName)
void setSyncParameters(SyncGeodatabaseParameters syncParameters)
Sets new synchronisation parameters for the synchronisation process which is called from the methods in the GeodatabaseSyncTask class.
static void setTempFolder(String tempPath)
This method is deprecated. since 10.2.4 with no replacement. The temporary output folder is getting set internally and users should not call this method.
String syncServerDelta(String path)
For internal use only
String toString()
Protected Methods
void finalize()
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Geodatabase (String path)

Instantiates a Geodatabase object by opening a geodatabase file (.geodatabase). Must have write access to the directory containing the .geodatabase file, otherwise a RuntimeException will be thrown.

The dispose() method should be called on Geodatabase instances when they are no longer required or before the application is closed. This will release resources used by the Geodatabase.

Parameters
path String: the path to a geodatabase
Throws
FileNotFoundException thrown when the geodatabase file does not exist at the specified path

public Geodatabase (String path, boolean useAdvancedSymbology)

Instantiates a Geodatabase object by opening a local geodatabase (.geodatabase file). Must have write access to the directory containing the .geodatabase file, otherwise a RuntimeException will be thrown. This constructor overload allows the calling code to set whether or not features will be rendered using advanced symbology.

The dispose() method should be called on Geodatabase instances when they are no longer required or before the application is closed. This will release resources used by the Geodatabase.

Parameters
path String: the path to a geodatabase
useAdvancedSymbology boolean: true to render features using advanced symbology, false otherwise
Throws
FileNotFoundException thrown when the geodatabase file does not exist at the specified path

Public Methods

public void acknowledgeUpload (SyncGeodatabaseParameters syncParameters)

For internal use only

public void createClientDelta (String path)

For internal use only

Parameters
path String

public void dispose ()

Disposes the geodatabase. This method must be called when closing an application (or when otherwise finished with the geodatabase) to release resources which use the Geodatabase class.

public boolean equals (Object obj)

Parameters
obj Object
Returns
boolean

public GeodatabaseFeatureTable getGeodatabaseFeatureTableByLayerId (int layer)

Retrieves a table using its service layer ID.

Parameters
layer int: the service layer ID
Returns
GeodatabaseFeatureTable A table in the geodatabase

public List<GeodatabaseFeatureTable> getGeodatabaseTables ()

Gets a list of tables contained in the geodatabase

Returns
List<GeodatabaseFeatureTable> the list of GeodatabaseFeatureTables

public long getHandle ()

For internal use only

Returns
long

public String getPath ()

Returns the location of the .geodatabase file

Returns
String String path

public GenerateGeodatabaseParameters getRegisterParameters ()

Returns the parameters which were used to create the geodatabase initially.

Returns
GenerateGeodatabaseParameters GenerateGeodatabaseParameters
Throws
IOException
Exception
IOException
Exception

public String getServiceURL ()

Returns the URL of service from which the geodatabase was created.

Returns
String the URL of service from which the geodatabase was created if it is sync enabled; returns empty string if the geodatabase is not sync enabled. For geodatabase files created with ArcGIS service version prior to 10.2.2, this returns the service name instead of the URL.

See also:

public SyncModel getSyncModel ()

Returns the synchronisation model which the geodatabase has been set up to use.

Returns
SyncModel sync model
Throws
Exception
Exception

public SyncGeodatabaseParameters getSyncParameters ()

Query synchronization parameters from the geodatabase. This will return a SyncGeodatabaseParameters instance set to match the current synchronisation settings for the geodatabase. This can be modified by the user if they wish to modify the synchronisation direction for the layers or entire database.

Returns
SyncGeodatabaseParameters the synchronization parameters
Throws
Exception
Exception

public boolean hasLocalEdits ()

Checks for local edits.

Returns
boolean true, if a geodatabase has any edits

public int hashCode ()

Returns
int

public boolean isSyncEnabled ()

Indicates whether this geodatabase was originally downloaded from a sync-enabled ArcGIS feature service.

Returns
boolean true if sync-enabled, false otherwise.

public void reRegister (String geodatabaseId, String userName)

Parameters
geodatabaseId String
userName String

public void setSyncParameters (SyncGeodatabaseParameters syncParameters)

Sets new synchronisation parameters for the synchronisation process which is called from the methods in the GeodatabaseSyncTask class.

Throws
IOException
IOException

public static void setTempFolder (String tempPath)

This method is deprecated.
since 10.2.4 with no replacement. The temporary output folder is getting set internally and users should not call this method.

Sets the temporary output folder of the geodatabase. The folder should have read and write permission for the application.

Parameters
tempPath String: a valid platform path.

public String syncServerDelta (String path)

For internal use only

Parameters
path String
Returns
String

public String toString ()

Returns
String

Protected Methods

protected void finalize ()