@Test public void testAbsToRelPath() { File testOutputDir = new File(absOutputPath); TimeSeriesModule.convertAbsolutPathsToRelative(testProduct, testOutputDir); assertEquals("and/a/product/file/product1.dim", getPathString(AbstractTimeSeries.PRODUCT_LOCATIONS, 0)); assertEquals("and/a/product/file/product2.dim", getPathString(AbstractTimeSeries.PRODUCT_LOCATIONS, 1)); assertEquals("and/a/product/file/product1.dim", getPathString(AbstractTimeSeries.SOURCE_PRODUCT_PATHS, 0)); assertEquals("and/a/product/file/product2.dim", getPathString(AbstractTimeSeries.SOURCE_PRODUCT_PATHS, 1)); }
static void convertAbsolutPathsToRelative(Product product, File outputDir) { final MetadataElement tsRootElem = product.getMetadataRoot().getElement(AbstractTimeSeries.TIME_SERIES_ROOT_NAME); final MetadataElement productLocations = tsRootElem.getElement(AbstractTimeSeries.PRODUCT_LOCATIONS); final MetadataElement sourceProductPaths = tsRootElem.getElement(AbstractTimeSeries.SOURCE_PRODUCT_PATHS); replaceWithRelativePaths(productLocations.getElements(), outputDir); replaceWithRelativePaths(sourceProductPaths.getElements(), outputDir); }
TimeSeriesModule { static void convertAbsolutPathsToRelative(Product product, File outputDir) { final MetadataElement tsRootElem = product.getMetadataRoot().getElement(AbstractTimeSeries.TIME_SERIES_ROOT_NAME); final MetadataElement productLocations = tsRootElem.getElement(AbstractTimeSeries.PRODUCT_LOCATIONS); final MetadataElement sourceProductPaths = tsRootElem.getElement(AbstractTimeSeries.SOURCE_PRODUCT_PATHS); replaceWithRelativePaths(productLocations.getElements(), outputDir); replaceWithRelativePaths(sourceProductPaths.getElements(), outputDir); } }
TimeSeriesModule { static void convertAbsolutPathsToRelative(Product product, File outputDir) { final MetadataElement tsRootElem = product.getMetadataRoot().getElement(AbstractTimeSeries.TIME_SERIES_ROOT_NAME); final MetadataElement productLocations = tsRootElem.getElement(AbstractTimeSeries.PRODUCT_LOCATIONS); final MetadataElement sourceProductPaths = tsRootElem.getElement(AbstractTimeSeries.SOURCE_PRODUCT_PATHS); replaceWithRelativePaths(productLocations.getElements(), outputDir); replaceWithRelativePaths(sourceProductPaths.getElements(), outputDir); }  }
TimeSeriesModule { static void convertAbsolutPathsToRelative(Product product, File outputDir) { final MetadataElement tsRootElem = product.getMetadataRoot().getElement(AbstractTimeSeries.TIME_SERIES_ROOT_NAME); final MetadataElement productLocations = tsRootElem.getElement(AbstractTimeSeries.PRODUCT_LOCATIONS); final MetadataElement sourceProductPaths = tsRootElem.getElement(AbstractTimeSeries.SOURCE_PRODUCT_PATHS); replaceWithRelativePaths(productLocations.getElements(), outputDir); replaceWithRelativePaths(sourceProductPaths.getElements(), outputDir); }   }
TimeSeriesModule { static void convertAbsolutPathsToRelative(Product product, File outputDir) { final MetadataElement tsRootElem = product.getMetadataRoot().getElement(AbstractTimeSeries.TIME_SERIES_ROOT_NAME); final MetadataElement productLocations = tsRootElem.getElement(AbstractTimeSeries.PRODUCT_LOCATIONS); final MetadataElement sourceProductPaths = tsRootElem.getElement(AbstractTimeSeries.SOURCE_PRODUCT_PATHS); replaceWithRelativePaths(productLocations.getElements(), outputDir); replaceWithRelativePaths(sourceProductPaths.getElements(), outputDir); }   static final String TIME_PROPERTY; }