org.apache.oodt.cas.metadata.util
Class PathUtils

java.lang.Object
  extended by org.apache.oodt.cas.metadata.util.PathUtils

public final class PathUtils
extends Object

Version:
$Revision$

A Utility class for replacing environment variables and maniuplating file path strings.

.
Author:
mattmann, bfoster

Field Summary
static String DELIMITER
           
 
Constructor Summary
PathUtils()
           
 
Method Summary
static String doDynamicDateFormatReplacement(String string, Metadata metadata)
           
static String doDynamicDateReplacement(String string, Metadata metadata)
           
static String doDynamicDateRollReplacement(String string, Metadata metadata)
          usage format: [DATE_ADD(,,,
)] example: [DATE_ADD(2009-12-31, yyyy-MM-dd, 1, day)] .
static String doDynamicDateToMillisReplacement(String string, Metadata metadata)
          Replaces String method of format [DATE_TO_MILLIS(,,)] with milliseconds between and
static String doDynamicDateToSecsReplacement(String string, Metadata metadata)
          Replaces String method of format [DATE_TO_SECS(,,)] with seconds between and
static String doDynamicReplacement(String string)
           
static String doDynamicReplacement(String string, Metadata metadata)
           
static String doDynamicUtcToTaiDateReplacement(String string, Metadata metadata)
          Replaces String method of format [UTC_TO_TAI()] with TAI time with format: "yyyy-MM-dd'T'HH:mm:ss.SSS-0000"
static String replaceEnvVariables(String origPath)
           
static String replaceEnvVariables(String origPath, Metadata metadata)
           
static String replaceEnvVariables(String origPath, Metadata metadata, boolean expand)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DELIMITER

public static String DELIMITER
Constructor Detail

PathUtils

public PathUtils()
Method Detail

replaceEnvVariables

public static String replaceEnvVariables(String origPath)

replaceEnvVariables

public static String replaceEnvVariables(String origPath,
                                         Metadata metadata)

replaceEnvVariables

public static String replaceEnvVariables(String origPath,
                                         Metadata metadata,
                                         boolean expand)

doDynamicReplacement

public static String doDynamicReplacement(String string)
                                   throws Exception
Throws:
Exception

doDynamicReplacement

public static String doDynamicReplacement(String string,
                                          Metadata metadata)
                                   throws Exception
Throws:
Exception

doDynamicDateReplacement

public static String doDynamicDateReplacement(String string,
                                              Metadata metadata)
                                       throws Exception
Throws:
Exception

doDynamicDateRollReplacement

public static String doDynamicDateRollReplacement(String string,
                                                  Metadata metadata)
                                           throws Exception
usage format: [DATE_ADD(,,,
)] example: [DATE_ADD(2009-12-31, yyyy-MM-dd, 1, day)] . . . output will be: 2010-01-01 - dynamic replacement is allowed for the as well, for example: [DATE_ADD([DATE.UTC], yyyy-MM-dd'T'HH:mm:ss.SSS'Z', 1, day)] will add one day to the current UTC time

Throws:
Exception

doDynamicDateFormatReplacement

public static String doDynamicDateFormatReplacement(String string,
                                                    Metadata metadata)
                                             throws Exception
Throws:
Exception

doDynamicUtcToTaiDateReplacement

public static String doDynamicUtcToTaiDateReplacement(String string,
                                                      Metadata metadata)
                                               throws Exception
Replaces String method of format [UTC_TO_TAI()] with TAI time with format: "yyyy-MM-dd'T'HH:mm:ss.SSS-0000"

Throws:
Exception

doDynamicDateToSecsReplacement

public static String doDynamicDateToSecsReplacement(String string,
                                                    Metadata metadata)
                                             throws Exception
Replaces String method of format [DATE_TO_SECS(,,)] with seconds between and

Throws:
Exception

doDynamicDateToMillisReplacement

public static String doDynamicDateToMillisReplacement(String string,
                                                      Metadata metadata)
                                               throws Exception
Replaces String method of format [DATE_TO_MILLIS(,,)] with milliseconds between and

Throws:
Exception


Copyright © 1999-2013
Apache OODT. All Rights Reserved.