IngestionTool { static String getArchivePath(File sourceFile, String productType, String revision, Pattern pattern) { String subPath = getDatePath(sourceFile, productType, pattern); return String.format("/calvalus/eodata/%s/%s/%s", productType, revision, subPath); }  static int handleIngestionCommand(CommandLine commandLine, String[] files, FileSystem hdfs); static String expand(Matcher source, String template); static final String DEFAULT_PRODUCT_TYPE; static final String DEFAULT_REVISION; static final DateFormat YEAR_MONTH_DAY_FORMAT; static final DateFormat YEAR_DAY_OF_YEAR_FORMAT; static final DateFormat YEAR2_DAY_OF_YEAR_FORMAT; static final DateFormat MONTH_DAY_YEAR2_FORMAT; static final long MINIMUM_BLOCK_SIZE; static final long MAXIMUM_BLOCK_SIZE; }
@Test public void testArchivePath() { String archivePath = IngestionTool.getArchivePath(new File("MER_RR__1POBCM20060718_091715_000001012049_00308_22907_0113.N1"), "MER_RR__1P", "r03", Pattern.compile("..............(....)(..)(..).*")); assertEquals("/calvalus/eodata/MER_RR__1P/r03/2006/07/18", archivePath); }