protected IVirtualArtifact wrap (IVirtualArtifact artifact) {
if (artifact == null) return null;
if ( !this.isSystemArtifact(artifact) && getSystemFor(artifact) != this ) {
if (artifact instanceof IVirtualFile) {
artifact = new DirectoryFileLinked(this, (IVirtualFile) artifact);
} else {
artifact = new DirectoryLinked((IVirtualDirectory)artifact);
}
}
return artifact;