IPath apfp = apf.getPath();
if (EnvironmentPathUtils.isFull(apfp)) {
apfp = EnvironmentPathUtils.getLocalPath(apfp);
external = true;
}
PharPath pharPath = PharPath.getPharPath(new Path(path));
if (pharPath != null) {
if (external
&& apfp.equals(new Path(pharPath.getPharName()))
|| !external
&& apfp.lastSegment().equals(
new Path(pharPath.getPharName())
.lastSegment())) {
if (pharPath.isPhar()) {
final String stubName = PharConstants.STUB_PATH;
pharPath.setFolder(new Path(stubName)
.removeLastSegments(1).toString());
pharPath.setFile(new Path(stubName)
.lastSegment());
}
IScriptFolder scriptFolder = apf
.getScriptFolder(new Path(pharPath
.getFolder()));
try {
IModelElement[] children = scriptFolder
.getChildren();
if (children != null && children.length > 0) {
for (int i = 0; i < children.length; i++) {
if (((ISourceModule) children[i])
.getElementName().equals(
pharPath.getFile())) {
return new IncludedPharFileResult(
scriptFolder,
(ISourceModule) children[i]);
}
}