java.lang.Object
org.gcube.accounting.aggregator.utility.Utility

public class Utility extends Object
Author:
Luca Frosini (ISTI - CNR)
  • Field Details

    • UTC_TIMEZONE

      public static TimeZone UTC_TIMEZONE
  • Constructor Details

    • Utility

      public Utility()
  • Method Details

    • getCurrentContext

      public static String getCurrentContext() throws Exception
      Throws:
      Exception
    • getHumanReadableDuration

      public static String getHumanReadableDuration(long duration)
    • printLine

      public static void printLine(File file, String line) throws Exception
      Throws:
      Exception
    • getUTCDateFormat

      public static DateFormat getUTCDateFormat(String pattern)
    • getUTCCalendarInstance

      public static Calendar getUTCCalendarInstance()
    • getPersistTimeDate

      public static Date getPersistTimeDate(String persistTimeString) throws ParseException
      Throws:
      ParseException
    • isTimeElapsed

      public static boolean isTimeElapsed(Calendar now, Date date) throws ParseException
      Throws:
      ParseException
    • getAggregationStartCalendar

      public static Calendar getAggregationStartCalendar(int year, int month, int day)
    • sanitizeDate

      public static Date sanitizeDate(AggregationType aggregationType, Date date)
    • getEndCalendarFromStartCalendar

      public static Calendar getEndCalendarFromStartCalendar(AggregationType aggregationType, Calendar aggregationStartCalendar, int offset)
    • getEndDateFromStartDate

      public static Date getEndDateFromStartDate(AggregationType aggregationType, Date aggregationStartDate, int offset)
    • getUsername

      public static String getUsername()
    • getMalformatedFile

      public static File getMalformatedFile(File aggregateRecordsBackupFile)