Java Month of Year getOntologyURIBase(String defaultBase, boolean appendYear, boolean appendMonth, boolean appendDay)

Here you can find the source of getOntologyURIBase(String defaultBase, boolean appendYear, boolean appendMonth, boolean appendDay)

Description

get Ontology URI Base

License

Open Source License

Declaration

public static String getOntologyURIBase(String defaultBase,
            boolean appendYear, boolean appendMonth, boolean appendDay) 

Method Source Code

//package com.java2s;
import java.util.Calendar;

public class Main {
    public static String getOntologyURIBase(String defaultBase,
            boolean appendYear, boolean appendMonth, boolean appendDay) {
        if (defaultBase != null && defaultBase.trim().length() > 0) {
            if (defaultBase.endsWith("/") == false) {
                defaultBase += "/";
            }// w  ww  .j  a  v  a 2s  .  c  om
            if (appendYear) {
                int year = Calendar.getInstance().get(Calendar.YEAR);
                defaultBase += year + "/";
                if (appendMonth) {
                    int month = Calendar.getInstance().get(Calendar.MONTH) + 1;
                    defaultBase += month + "/";
                    if (appendDay) {
                        int day = Calendar.getInstance().get(
                                Calendar.DAY_OF_MONTH);
                        defaultBase += day + "/";
                    }
                }
            }
        }
        return defaultBase;
    }
}

Related

  1. getNextMonthFirstDay(T day)
  2. getNextMonthFistDay(String nowdate, String inFormat, String outFormat)
  3. getNextYearMonth(String yearMonth)
  4. getNrDaysOfMonth(int month, int year)
  5. getNumberOfDays(int year, int month)
  6. getPreviousDateStringByMonth(int months)
  7. getPreviousDay(int year, int month, int day, int days)
  8. getPrevMonth(String divisionDate, int day, String outputFormat)
  9. getPreYearMonth()