@@ -0,0 +1,1626 @@
+/*%0A * Copyright 2013 Alex Lin.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.opoo.press.util;%0A%0Aimport java.util.Calendar;%0Aimport java.util.Date;%0Aimport java.util.Map;%0A%0Aimport org.apache.commons.lang.StringUtils;%0A%0A/**%0A * @author Alex Lin%0A *%0A */%0Apublic abstract class LinkUtils %7B%0A%09%0A%09public static void addDateParams(Map%3CString,Object%3E params, Date date)%7B%0A%09%09if(date == null)%7B%0A%09%09%09date = new Date();%0A%09%09%7D%0A%09%09if(params == null)%7B%0A%09%09%09return;%0A%09%09%7D%0A%09%09Calendar c = Calendar.getInstance();%0A%09%09c.setTime(date);%0A%09%09int year = c.get(Calendar.YEAR);%0A%09%09int monthnum = c.get(Calendar.MONTH) + 1;%0A%09%09int day = c.get(Calendar.DAY_OF_MONTH);%0A%09%09int hour = c.get(Calendar.HOUR_OF_DAY);%0A%09%09int minute = c.get(Calendar.MINUTE);%0A%09%09int second = c.get(Calendar.SECOND);%0A%09%09%0A%09%09params.put(%22year%22, year + %22%22);%0A%09%09params.put(%22month%22, StringUtils.leftPad(monthnum + %22%22, 2, '0'));%0A%09%09params.put(%22day%22, StringUtils.leftPad(day + %22%22, 2, '0'));%0A%09%09params.put(%22hour%22, StringUtils.leftPad(hour + %22%22, 2, '0'));%0A%09%09params.put(%22minute%22, StringUtils.leftPad(minute + %22%22, 2, '0'));%0A%09%09params.put(%22second%22, StringUtils.leftPad(second + %22%22, 2, '0'));%0A%09%7D%0A%7D%0A

Add LinkUtils