Skip to content

Commit

Permalink
Merge branch 'maint-5.x' into Classifier
Browse files Browse the repository at this point in the history
  • Loading branch information
matakleo committed Jun 21, 2024
2 parents a751329 + 98545e9 commit 893a93c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ USER root

# TODO use release version of d4ts
#ENV D4TS_WAR_URL https://artifacts.unidata.ucar.edu/repository/unidata-releases/edu/ucar/d4ts/5.4/d4ts-5.4.war
ENV D4TS_WAR_URL https://artifacts.unidata.ucar.edu/repository/unidata-snapshots/edu/ucar/d4ts/5.5-SNAPSHOT/d4ts-5.5-20240507.221412-201.war
ENV D4TS_WAR_URL https://artifacts.unidata.ucar.edu/repository/unidata-snapshots/edu/ucar/d4ts/5.5-SNAPSHOT/d4ts-5.5-20240603.195123-208.war
ENV DTS_WAR_URL https://artifacts.unidata.ucar.edu/repository/unidata-releases/edu/ucar/dtswar/5.4/dtswar-5.4.war

# Install necessary packages
Expand Down
4 changes: 3 additions & 1 deletion cdm/core/src/main/java/thredds/filesystem/MFileOS.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ public String getName() {
return file.getName();
}

@Nullable
@Override
public MFile getParent() {
return new MFileOS(file.getParentFile());
File parent = file.getParentFile();
return parent == null ? null : new MFileOS(parent);
}

@Override
Expand Down
5 changes: 0 additions & 5 deletions cdm/core/src/main/java/ucar/nc2/filter/Classifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public static Classifier createFromVariable(VariableDS var) {
}
}


public static Classifier emptyClassifier() {
emptyClassifier = new Classifier();
return emptyClassifier;
Expand Down Expand Up @@ -59,7 +58,6 @@ public int[] classifyWithAttributes(Array arr) {
return classifiedArray;
}


/** Classify double array */
public int[] classifyDoubleArray(Array arr) {
int[] classifiedArray = new int[(int) arr.getSize()];
Expand Down Expand Up @@ -136,7 +134,4 @@ public static int[] stringToIntArray(String str) {
return intArray;
}


}


Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import static com.google.common.truth.Truth.assertThat;
import static ucar.ma2.MAMath.nearlyEquals;

import java.io.IOException;
import java.util.Arrays;
import java.util.List;
Expand Down Expand Up @@ -139,4 +138,5 @@ public void testEnhanceClassifier_classification() throws IOException {
}

}

}
10 changes: 10 additions & 0 deletions cdm/core/src/test/java/ucar/nc2/util/TestURLnaming.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

package ucar.nc2.util;

import static com.google.common.truth.Truth.assertThat;

import java.lang.invoke.MethodHandles;
import org.junit.Test;
import org.slf4j.Logger;
Expand All @@ -30,6 +32,14 @@ public void testResolve() {
testResolve("file://test/me/", "file:/wanna", "file:/wanna");
testResolve("file://test/me/", "C:/wanna", "C:/wanna");
testResolve("http://test/me/", "file:wanna", "file:wanna");

testResolve("urlWithoutSlash", "file:///path/with/slash", "file:///path/with/slash");
}

@Test
public void testResolveFile() {
assertThat(URLnaming.resolveFile("urlWithoutSlash", "file:///path/with/slash"))
.isEqualTo("file:///path/with/slash");
}

private void testResolve(String base, String rel, String result) {
Expand Down

0 comments on commit 893a93c

Please sign in to comment.