protected static String formatDateStr(String startDate, String strDays) {

        // Initial Calendar object
        Calendar cal = Calendar.getInstance();
        int days;
        startDate = startDate.replaceAll("/", "");
        try {
            days = Double.valueOf(strDays).intValue();
            // Set date with input value
            cal.set(Integer.parseInt(startDate.substring(0, 4)), Integer.parseInt(startDate.substring(4, 6)) - 1, Integer.parseInt(startDate.substring(6)));
            cal.add(Calendar.DATE, days);
            // translatet to yyddd format
            return String.format("%1$02d%2$03d", cal.get(Calendar.YEAR) % 100, cal.get(Calendar.DAY_OF_YEAR));
        } catch (Exception e) {
            // if tranlate failed, then use default value for date
            // sbError.append("! Waring: There is a invalid date [").append(startDate).append("]\r\n");
            return "-99"; //formatDateStr(defValD);
        }

    }
protected static String formatDateStr ( String startDate , String strDays ) { Calendar cal = Calendar . getInstance ( ) ; int days ; startDate = startDate . replaceAll ( "/" , "" ) ; try { days = Double . valueOf ( strDays ) . intValue ( ) ; cal . set ( Integer . parseInt ( startDate . substring ( 0 , 4 ) ) , Integer . parseInt ( startDate . substring ( 4 , 6 ) ) - 1 , Integer . parseInt ( startDate . substring ( 6 ) ) ) ; cal . add ( Calendar . DATE , days ) ; return String . format ( "%1$02d%2$03d" , cal . get ( Calendar . YEAR ) % 100 , cal . get ( Calendar . DAY_OF_YEAR ) ) ; } catch ( Exception e ) { return "-99" ; } }
Translate data str from "yyyymmdd" to "yyddd" plus days you want

@param startDate date string with format of "yyyymmdd"
@param strDays the number of days need to be added on
@return result date string with format of "yyddd"