Sentinel-2 readers have NetBeans dependencies

Description

The library module "lib-openjpeg" has code dependecies to NetBeans modules and is used by several S2TBX modules which should actually independent of NetBeans, namely all the product readers.

It was agreed, that only GUI modules should have NetBeans dependencies. Otherwise we cannot run such modules in GUI-free / headless environments.

Environment

None

GitHub Work

None

Activity

Show:

Julien Malik20 November 2015 at 15:06

Closing for 2.0 release

Nicolas Ducoin19 August 2015 at 09:03

Change of openjpeg executables rights at start of NetBeans is now done when opening the first S2 product.
OpenJpeg executables are now search in known places instead of NetBeans places.

Norman Fomferra17 August 2015 at 11:24
Edited

The problem seems to have its origin in using the NetBeans filtered resources (nbmResources element in NB Maven plugin in pom.xml of lib-openjpeg). In source code, this requires use of org.openide.modules.InstalledFileLocator class.

However, in SNAP, we use the SystemUtils.getAuxDataPath() or SystemUtils.getApplicationDataDir() to write/read application-specific resources to/from the local file system. See usages in code (ALT+F7). Here is an example:

private Path installAuxiliaryData() throws IOException { Path auxDataDir = SystemUtils.getAuxDataPath().resolve("s2tbx/openjpeg").toAbsolutePath(); // todo - test here if all files in auxDataDir are up to date (e.g. check version and/or file creation time). // If so return immediately. // Otherwise: Path sourcePath = ResourceInstaller.findModuleCodeBasePath(getClass()).resolve("openjpeg-" + getPlatformId()); ResourceInstaller installer = new ResourceInstaller(sourcePath, auxDataDir); installer.install(".*", ProgressMonitor.NULL); return auxDataDir; }
Done

Details

Assignee

Reporter

Fix versions

Due date

Priority

Created 17 August 2015 at 09:48
Updated 10 February 2023 at 14:26
Resolved 10 February 2023 at 14:21