if(value.indexOf(LocalJsonFileSource.pathSeparator) != -1){
pathIndex = 10000;
}
}
String subObjectId;
DataSource source = null;
String path = null;
int slashIndex = value.length();
if (value.indexOf("/") > 0 && value.indexOf("/") < pathIndex){
while((slashIndex = value.substring(0,slashIndex).lastIndexOf('/')) > -1){
String sourcePart = value.substring(0,slashIndex);
source = DataSourceManager.getSource(sourcePart);
if (source != null)
break;
}
if (source == null)
return new ObjectNotFoundId(null,value);
String idPart = value.substring(slashIndex + 1);
subObjectId = idPart;
/*if (pathIndex < 10000 && !(source instanceof HttpJsonSource)) {
pathIndex = pathIndex - sourcePart.length() - 1;
path = subObjectId.substring(pathIndex);
subObjectId = subObjectId.substring(0,pathIndex);
}*/
}
else {
subObjectId = value;
if (pathIndex < 10000) {
path = subObjectId.substring(pathIndex);
subObjectId = subObjectId.substring(0,pathIndex);
}
source = DataSourceManager.getSource(subObjectId);
if (source == null) {
AliasHandler handler = AliasIds.getAliasHandler(subObjectId);
ObjectId objId;
if (handler == null) {
return new ObjectNotFoundId(source,value);
}
objId = handler.getTarget().getId();
source = objId.getSource();
if (source == null && handler != null)
return handler;
subObjectId = objId.getSubObjectId();
}
else
subObjectId = ""; // this is a direct reference to the source, the id should be null
}
String slashedSubObjectId = null;
if (subObjectId != null) {
/*while (!subObjectId.equals(slashedSubObjectId)) {
slashedSubObjectId = subObjectId;
subObjectId = subObjectId.replaceAll("^([^\\[]+)/", "$1."); // allow slashes to indicate property references
}*/
int legalDotStart = 0;
if (source instanceof HttpJsonSource && source.getId().length() < 8) {
// if we are using a remote address, the first dots can be part of the hostname and should be ignored
legalDotStart = subObjectId.indexOf('/', 2);
}
pathIndex = Math.min(Math.min(subObjectId.indexOf('[') > -1 ? subObjectId.indexOf('[') : 10000, subObjectId.indexOf('.', legalDotStart) > -1 ? subObjectId.indexOf('.', legalDotStart) : 10000),subObjectId.indexOf('?') > -1 ? subObjectId.indexOf('?') : 10000);
if (pathIndex < 10000 &&