@@ -632,7 +632,36 @@ ClassMethod NormalizeFolder(folder As %String) As %String
632632
633633ClassMethod ExternalName (InternalName As %String , ByRef MappingExists As %Boolean ) As %String
634634{
635- quit $Replace (..Name (.InternalName ,.MappingExists )," /" ,..#Slash)
635+ set root = ..TempFolder ()
636+ set file = $Replace (..Name (.InternalName ,.MappingExists )," /" ,..#Slash)
637+ set fullFile = root _file
638+ if '..Exists (.fullFile ) {
639+ quit file
640+ }
641+ quit $Piece (fullFile ,root ,2 ,*)
642+ }
643+
644+ /// Check if file exists but case insensitive on file extension
645+ /// Stolen from %IPM.Utils.File
646+ ClassMethod Exists (ByRef pFilename ) As %Boolean
647+ {
648+ If ##class (%File ).Exists (pFilename ) {
649+ Return 1
650+ }
651+ Set tDirectory = ##class (%File ).ParentDirectoryName (pFilename )
652+ If '##class (%File ).DirectoryExists (tDirectory ) {
653+ Return 0
654+ }
655+ Set tName = $Piece (pFilename , tDirectory , 2 , *)
656+ Set tFileName = $Piece (tName , " ." , 1 , * - 1 )
657+ Set tFileExt = $Piece (tName , " ." , *)
658+ for tExt = $$$LOWER(tFileExt ), $$$UPPER(tFileExt ) {
659+ If ##class (%File ).Exists (tDirectory _ tFileName _ " ." _ tExt ) {
660+ Set pFilename = tDirectory _ tFileName _ " ." _ tExt
661+ Return 1
662+ }
663+ }
664+ Return 0
636665}
637666
638667ClassMethod AddToServerSideSourceControl (InternalName As %String ) As %Status
@@ -2711,3 +2740,4 @@ ClassMethod BaselineExport(pCommitMessage = "", pPushToRemote = "") As %Status
27112740}
27122741
27132742}
2743+
0 commit comments