Skip to content

Commit

Permalink
Merge branch 'master' into do-20240510-qa-enabled-exec-pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
dotasek committed Feb 6, 2025
2 parents 10c7ad3 + 48098d9 commit 7f5ef5e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -323,21 +323,9 @@
import org.hl7.fhir.r5.utils.structuremap.StructureMapUtilities;
import org.hl7.fhir.r5.utils.validation.IValidationProfileUsageTracker;
import org.hl7.fhir.r5.utils.validation.ValidatorSession;
import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
import org.hl7.fhir.utilities.DurationUtil;
import org.hl7.fhir.utilities.FhirPublication;
import org.hl7.fhir.utilities.IniFile;
import org.hl7.fhir.utilities.MarkDownProcessor;
import org.hl7.fhir.utilities.*;
import org.hl7.fhir.utilities.MarkDownProcessor.Dialect;
import org.hl7.fhir.utilities.MimeType;
import org.hl7.fhir.utilities.StandardsStatus;
import org.hl7.fhir.utilities.StringPair;
import org.hl7.fhir.utilities.FileUtilities;
import org.hl7.fhir.utilities.TimeTracker;
import org.hl7.fhir.utilities.TimeTracker.Session;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.VersionUtilities;
import org.hl7.fhir.utilities.ZipGenerator;
import org.hl7.fhir.utilities.filesystem.CSFile;
import org.hl7.fhir.utilities.http.HTTPResult;
import org.hl7.fhir.utilities.http.ManagedWebAccess;
Expand Down Expand Up @@ -3227,7 +3215,7 @@ else if (p.getValue().equals("no-experimental-content"))
break;
case "auto-oid-root":
oidRoot = p.getValue();
if (!Utilities.isValidOID(oidRoot)) {
if (!OIDUtilities.isValidOID(oidRoot)) {
throw new Error("Invalid oid found in assign-missing-oids-root: "+oidRoot);
}
oidIni = new IniFile(oidIniLocation());
Expand Down Expand Up @@ -4049,11 +4037,11 @@ protected static void unzipToDirectory(InputStream inputStream, String zipTarget
if (entry.isDirectory()) {
continue;
}
String n = Utilities.makeOSSafe(entry.getName());
String n = CompressionUtilities.makeOSSafe(entry.getName());
String filename = Utilities.path(zipTargetDirectory, n);
String dir = FileUtilities.getDirectoryForFile(filename);

Utilities.zipSlipProtect(n, Path.of(dir));
CompressionUtilities.zipSlipProtect(n, Path.of(dir));
FileUtilities.createDirectory(dir);

FileOutputStream output = new FileOutputStream(filename);
Expand Down Expand Up @@ -4194,7 +4182,7 @@ private void loadIg(ImplementationGuideDependsOnComponent dep, int index, boolea
String name = dep.getId();
if (!dep.hasId()) {
logMessage("Dependency '"+idForDep(dep)+"' has no id, so can't be referred to in markdown in the IG");
name = "u"+Utilities.makeUuidLC().replace("-", "");
name = "u"+UUIDUtilities.makeUuidLC().replace("-", "");
}
if (!isValidIGToken(name))
throw new Exception("IG Name must be a valid token ("+name+")");
Expand Down Expand Up @@ -14653,7 +14641,7 @@ private static String convertUrlToLocalIg(String ig) throws IOException {

String ghUrl = "https://github.com/"+org+"/"+repo+"/archive/refs/heads/"+branch+".zip";
InputStream zip = fetchGithubUrl(ghUrl);
Utilities.unzip(zip, Paths.get(f.getAbsolutePath()));
CompressionUtilities.unzip(zip, Paths.get(f.getAbsolutePath()));
for (File fd : f.listFiles()) {
if (fd.isDirectory()) {
return fd.getAbsolutePath();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
import org.hl7.fhir.r5.utils.UserDataNames;
import org.hl7.fhir.utilities.HL7WorkGroups;
import org.hl7.fhir.utilities.HL7WorkGroups.HL7WorkGroup;
import org.hl7.fhir.utilities.OIDUtilities;
import org.hl7.fhir.utilities.StandardsStatus;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.validation.ValidationOptions;
Expand Down Expand Up @@ -976,7 +977,7 @@ else if (l > 60) {
}
l = l + (ec.hasExpression() ? ec.getExpression().length() : 0);
if (ec.getType() == ExtensionContextType.ELEMENT) {
String ref = Utilities.oidRoot(ec.getExpression());
String ref = OIDUtilities.oidRoot(ec.getExpression());
if (ref.startsWith("@"))
ref = ref.substring(1);
if (ref.contains(".")) {
Expand Down Expand Up @@ -1206,7 +1207,7 @@ private void findValueSets(List<ValueSet> list, OperationDefinition opd) {
for (OperationDefinitionParameterComponent p : opd.getParameter()) {
if (p.hasBinding()) {
resolveVS(list, p.getBinding().getValueSet(), opd);
};
};
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;

import org.hl7.fhir.utilities.CompressionUtilities;
import org.hl7.fhir.utilities.FTPClient;
import org.hl7.fhir.utilities.FileUtilities;
import org.hl7.fhir.utilities.Utilities;
Expand Down Expand Up @@ -115,7 +116,7 @@ protected static void cleanZipTargets(Path target, InputStream inputStream) thro
try (ZipInputStream zis = new ZipInputStream(inputStream)) {
ZipEntry zipEntry = zis.getNextEntry();
while (zipEntry != null) {
Path newPath = Utilities.zipSlipProtect(Utilities.makeOSSafe(zipEntry.getName()), target);
Path newPath = CompressionUtilities.zipSlipProtect(CompressionUtilities.makeOSSafe(zipEntry.getName()), target);
if (Files.exists(newPath)) {
Files.delete(newPath);
}
Expand Down

0 comments on commit 7f5ef5e

Please sign in to comment.