Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 113 additions & 1 deletion file_checker_exec/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -1,10 +1,122 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.builder.annotationPath.allLocations=disabled
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
org.eclipse.jdt.core.compiler.annotation.notowning=org.eclipse.jdt.annotation.NotOwning
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.annotation.owning=org.eclipse.jdt.annotation.Owning
org.eclipse.jdt.core.compiler.annotation.resourceanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.APILeak=warning
org.eclipse.jdt.core.compiler.problem.annotatedTypeArgumentToUnannotated=info
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompatibleOwningContract=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
org.eclipse.jdt.core.compiler.problem.insufficientResourceAnalysis=warning
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.suppressWarningsNotFullyAnalysed=info
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_arrows_in_switch_on_columns=false
org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false
Expand Down
11 changes: 10 additions & 1 deletion file_checker_exec/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>fr.ifremer</groupId>
<artifactId>file_checker_exec</artifactId>
<version>3.0.0</version>
<version>3.0.1</version>

<name>Argo NetCDF file format checker</name>

Expand Down Expand Up @@ -161,6 +161,15 @@
</testResource>
</testResources>
<plugins>
<!-- Enforce Java 8 API compatibility -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<release>8</release>
</configuration>
</plugin>
<!--Rename the log4j2 xml production file-->
<plugin>
<groupId>com.coderplus.maven.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2372,7 +2372,7 @@ private void addParamEntries(List<R03DeprecatedEntry> entries, String paramName,
String oldValue, String status, String message, String version) {

// Always: base + ADJUSTED
List<String> names = new ArrayList<>(List.of(paramName, paramName + "_ADJUSTED"));
List<String> names = new ArrayList<>(Arrays.asList(paramName, paramName + "_ADJUSTED"));

// ADJUSTED_ERROR — excluded for min/max/name attributes
boolean excludeFromAdjustedError = attributeKey.equals("valid_min") || attributeKey.equals("valid_max")
Expand All @@ -2385,7 +2385,7 @@ private void addParamEntries(List<R03DeprecatedEntry> entries, String paramName,

// STD & MED family — units and fillValue share the same oldValue
if (attributeKey.equals("units") || attributeKey.equals("fillValue")) {
names.addAll(List.of(paramName + "_STD", paramName + "_MED", paramName + "_STD_ADJUSTED",
names.addAll(Arrays.asList(paramName + "_STD", paramName + "_MED", paramName + "_STD_ADJUSTED",
paramName + "_MED_ADJUSTED", paramName + "_STD_ADJUSTED_ERROR", paramName + "_MED_ADJUSTED_ERROR"));
}

Expand All @@ -2399,9 +2399,11 @@ private void addParamEntries(List<R03DeprecatedEntry> entries, String paramName,

// long_name — STD/MED variants get a prefixed oldValue
if (attributeKey.equals("long_name")) {
Map<String, String> longNameVariants = Map.of(paramName + "_STD", "Standard deviation of " + oldValue,
paramName + "_MED", "Median value of " + oldValue, paramName + "_STD_ADJUSTED",
"Standard deviation of " + oldValue, paramName + "_MED_ADJUSTED", "Median value of " + oldValue);
Map<String, String> longNameVariants = new HashMap<>();
longNameVariants.put(paramName + "_STD", "Standard deviation of " + oldValue);
longNameVariants.put(paramName + "_MED", "Median value of " + oldValue);
longNameVariants.put(paramName + "_STD_ADJUSTED", "Standard deviation of " + oldValue);
longNameVariants.put(paramName + "_MED_ADJUSTED", "Median value of " + oldValue);
longNameVariants.forEach((name, derivedValue) -> entries
.add(new R03DeprecatedEntry(name, attributeKey, derivedValue, status, message)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,6 @@ public static void initializeFromInternet(String baseUrl) {
} catch (IOException e) {
stderr.println("Table file not found on NVS : " + tableUrl + " (" + e.getMessage() + ")");
break;
} catch (InterruptedException e) {
stderr.println("Error while retrieving table on NVS : " + tableUrl + " (" + e.getMessage() + ")");
break;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,37 @@

import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
import java.time.Duration;
import java.net.HttpURLConnection;
import java.net.URL;

public final class NetUtils {
private static final HttpClient httpClient = HttpClient.newBuilder().followRedirects(HttpClient.Redirect.NORMAL)
.build(); // need to automatically follow redirection

public static InputStream openInputStream(String url) throws IOException, InterruptedException {

// create request
HttpRequest req = HttpRequest.newBuilder(URI.create(url)).timeout(Duration.ofSeconds(15))
.header("Accept", "application/ld+json").GET().build();

// send request :
HttpResponse<InputStream> res = httpClient.send(req, BodyHandlers.ofInputStream());

// client error response
if (res.statusCode() >= 400) {
// close stream if serveur send one
try (InputStream body = res.body()) {
/* ensure release */ }
throw new IOException("HTTP " + res.statusCode() + " for " + url);
private static final int TIMEOUT_MS = 15_000;

public static InputStream openInputStream(String url) throws IOException {

HttpURLConnection conn = (HttpURLConnection) new URL(url).openConnection();
conn.setInstanceFollowRedirects(true); // follow redirects
conn.setConnectTimeout(TIMEOUT_MS);
conn.setReadTimeout(TIMEOUT_MS);
conn.setRequestProperty("Accept", "application/ld+json");
conn.setRequestMethod("GET");
conn.connect();

int status = conn.getResponseCode();

// client/server error response
if (status >= 400) {
try (InputStream err = conn.getErrorStream()) {
if (err != null) {
byte[] buf = new byte[1024];
while (err.read(buf) != -1) {
/* drain */ }
}
}
throw new IOException("HTTP " + status + " for " + url);
}

return res.body();
return conn.getInputStream();
}

}
4 changes: 2 additions & 2 deletions file_checker_exec/src/main/resources/log4j2-prod.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
<Loggers>
<Logger name="ArgoFileSpecification" level="warn" additivity="false">
<AppenderRef ref="Console"/>
<AppenderRef ref="File"/>
<AppenderRef ref="File" level="off"/>
</Logger>
<Logger name="ValidateSubmit" level="warn" additivity="false">
<AppenderRef ref="Console"/>
<AppenderRef ref="File"/>
<AppenderRef ref="File" level="off"/>
</Logger>
<Root level="off" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,13 @@ private static String executeJarAndGetResult(String fileName, String dac, String
assertThat(TestsUtils.outputDir).exists().isDirectory().as("output directory should exist");

// ACT
List<String> command = new ArrayList<>(List.of("java", "-jar", TestsUtils.jarPath));
if (options != null && !options.isBlank()) {
List<String> command = new ArrayList<>(Arrays.asList("java", "-jar", TestsUtils.jarPath));
if (options != null && !options.trim().isEmpty()) {
// split eventual multiple options
command.addAll(Arrays.asList(options.split("\\s+")));
}
command.addAll(List.of(dac, TestsUtils.SPEC_DIR_PATH, TestsUtils.OUTPUT_DIR_PATH, inputDirPath, fileName));
command.addAll(
Arrays.asList(dac, TestsUtils.SPEC_DIR_PATH, TestsUtils.OUTPUT_DIR_PATH, inputDirPath, fileName));
ProcessBuilder builder = new ProcessBuilder(command);
builder.redirectErrorStream(true);
Process process = builder.start();
Expand Down
Loading