use of com.revolsys.io.PathName in project com.revolsys.open by revolsys.
the class ArcGisRestServerRecordLayer method setLayerDescription.
public void setLayerDescription(final FeatureLayer layerDescription) {
this.layerDescription = layerDescription;
if (layerDescription != null) {
final String name = layerDescription.getName();
setName(name);
final UrlResource url = layerDescription.getRootServiceUrl();
setUrl(url);
final PathName pathName = layerDescription.getPathName();
setLayerPath(pathName);
final long minScale = layerDescription.getMinScale();
setMinimumScale(minScale);
final long maxScale = layerDescription.getMaxScale();
setMaximumScale(maxScale);
}
}
use of com.revolsys.io.PathName in project com.revolsys.open by revolsys.
the class PathNameEditor method setAsText.
@Override
public void setAsText(final String text) throws IllegalArgumentException {
final PathName pathName = PathName.newPathName(text);
setValue(pathName);
}
use of com.revolsys.io.PathName in project com.revolsys.open by revolsys.
the class PathTest method assertChildPath.
private void assertChildPath(final String parentPath, final String childPath, final String expected) {
final String childName = PathUtil.getChildPath(parentPath, childPath);
Assert.assertEquals(expected, childName);
final PathName pathName1 = PathName.newPathName(parentPath);
final PathName pathName2 = PathName.newPathName(childPath);
if (pathName1 != null) {
final PathName childPathName = pathName1.getChild(pathName2);
if (expected == null) {
Assert.assertNull("getChildPath", childPathName);
} else {
Assert.assertEquals("getChildPath " + pathName1 + ", " + pathName2, PathName.newPathName(expected), childPathName);
}
}
}
use of com.revolsys.io.PathName in project com.revolsys.open by revolsys.
the class PathTest method assertPath.
private void assertPath(final String source, final String expected) {
final String path = PathUtil.getPath(source);
Assert.assertEquals(expected, path);
if (Property.hasValue(source)) {
final PathName parent = PathName.newPathName(source).getParent();
if (parent != null) {
Assert.assertEquals(expected, parent.toString());
}
}
}
use of com.revolsys.io.PathName in project com.revolsys.open by revolsys.
the class FileGdbRecordStore method refreshSchemaElements.
@Override
protected Map<PathName, ? extends RecordStoreSchemaElement> refreshSchemaElements(final RecordStoreSchema schema) {
synchronized (this.apiSync) {
synchronized (API_SYNC) {
final Map<PathName, RecordStoreSchemaElement> elementsByPath = new TreeMap<>();
final Geodatabase geodatabase = getGeodatabase();
if (geodatabase != null) {
try {
final PathName schemaPath = schema.getPathName();
final String schemaCatalogPath = getCatalogPath(schema);
final VectorOfWString childDatasets = getChildDatasets(geodatabase, schemaCatalogPath, "Feature Dataset");
if (childDatasets != null) {
for (int i = 0; i < childDatasets.size(); i++) {
final String childCatalogPath = childDatasets.get(i);
final PathName childPath = toPath(childCatalogPath);
RecordStoreSchema childSchema = schema.getSchema(childPath);
if (childSchema == null) {
childSchema = newFeatureDatasetSchema(schema, childPath);
} else {
if (childSchema.isInitialized()) {
childSchema.refresh();
}
}
elementsByPath.put(childPath, childSchema);
}
}
if (schemaPath.isParentOf(this.defaultSchemaPath) && !elementsByPath.containsKey(this.defaultSchemaPath)) {
final SpatialReference spatialReference = getSpatialReference(getGeometryFactory());
final RecordStoreSchema childSchema = newSchema(this.defaultSchemaPath, spatialReference);
elementsByPath.put(this.defaultSchemaPath, childSchema);
}
if (schema.equalPath(this.defaultSchemaPath)) {
refreshSchemaRecordDefinitions(elementsByPath, schemaPath, "\\", "Feature Class");
refreshSchemaRecordDefinitions(elementsByPath, schemaPath, "\\", "Table");
}
refreshSchemaRecordDefinitions(elementsByPath, schemaPath, schemaCatalogPath, "Feature Class");
refreshSchemaRecordDefinitions(elementsByPath, schemaPath, schemaCatalogPath, "Table");
} finally {
releaseGeodatabase();
}
}
return elementsByPath;
}
}
}
Aggregations