Example usage for java.util Locale KOREA

List of usage examples for java.util Locale KOREA

Introduction

In this page you can find the example usage for java.util Locale KOREA.

Prototype

Locale KOREA

To view the source code for java.util Locale KOREA.

Click Source Link

Document

Useful constant for country.

Usage

From source file:com.opendesign.utils.Day.java

public static SimpleDateFormat getFormatter() {
    //   formatter = null;
    //   if (formatter == null)
    //       formatter = new SimpleDateFormat("yyyyMMddHHmmss");
    if (formatter == null)
        formatter = new SimpleDateFormat("yyyyMMddHHmmss", Locale.KOREA);
    return formatter;
}

From source file:com.example.administrator.myapplication2._2_exercise._2_Status_heart.fragments.LeftFragment.java

public void postJsonData1() {
    try {// w w w .  j  ava2s  . c  om

        SharedPreferences myPrefs = getActivity().getSharedPreferences("login", Context.MODE_PRIVATE);
        if ((myPrefs != null) && (myPrefs.contains("id"))) {
            id = myPrefs.getString("id", "");
        }
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.KOREA);
        String str_date = df.format(new Date());

        RequestParams a = new RequestParams();
        a.put("id", id);
        a.put("ldate", str_date);
        a.put("ldistance", "0.0");
        a.put("kal", "0");
        a.put("hb", "0");
        a.put("weight", "0");
        a.put("runtime", "0");
        a.setUseJsonStreamer(true);

        Log.i("boogil", a.toString());

        HttpPostDateTest1(a);
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:org.apache.logging.log4j.core.util.datetime.FastDateParserTest.java

@Test
public void testLang1121() throws ParseException {
    final TimeZone kst = TimeZone.getTimeZone("KST");
    final DateParser fdp = getInstance("yyyyMMdd", kst, Locale.KOREA);

    try {/*from  w  w  w . j a va2  s .co m*/
        fdp.parse("2015");
        Assert.fail("expected parse exception");
    } catch (final ParseException pe) {
        // expected parse exception
    }

    // Wed Apr 29 00:00:00 KST 2015
    Date actual = fdp.parse("20150429");
    final Calendar cal = Calendar.getInstance(kst, Locale.KOREA);
    cal.clear();
    cal.set(2015, 3, 29);
    Date expected = cal.getTime();
    Assert.assertEquals(expected, actual);

    final SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd", Locale.KOREA);
    df.setTimeZone(kst);
    expected = df.parse("20150429113100");

    // Thu Mar 16 00:00:00 KST 81724
    actual = fdp.parse("20150429113100");
    Assert.assertEquals(expected, actual);
}

From source file:egovframework.asadal.asapro.com.utl.fcc.service.AsaproEgovStringUtil.java

License:asdf

/**
 * ??? ?   ?17??TIMESTAMP?  //from   ww w.j a v  a2  s. c  o  m
 *
 * @param
 * @return Timestamp 
 * @exception MyException
 * @see
 */
public static String getTimeStamp() {

    String rtnStr = null;

    // ?    (?--? :::(?? ))
    String pattern = "yyyyMMddhhmmssSSS";

    try {
        SimpleDateFormat sdfCurrent = new SimpleDateFormat(pattern, Locale.KOREA);
        Timestamp ts = new Timestamp(System.currentTimeMillis());

        rtnStr = sdfCurrent.format(ts.getTime());
    } catch (Exception e) {
        log.error(e.getMessage());
    }

    return rtnStr;
}

From source file:egovframework.asadal.asapro.com.cmm.util.AsaproEgovStringUtil.java

License:asdf

/**
 * ??? ?   ?17??TIMESTAMP?  /*w  w w.  j  a va  2 s. c  om*/
 *
 * @param
 * @return Timestamp 
 * @exception MyException
 * @see
 */
public static String getTimeStamp() {

    String rtnStr = null;

    // ?    (?--? :::(?? ))
    String pattern = "yyyyMMddhhmmssSSS";

    try {
        SimpleDateFormat sdfCurrent = new SimpleDateFormat(pattern, Locale.KOREA);
        Timestamp ts = new Timestamp(System.currentTimeMillis());

        rtnStr = sdfCurrent.format(ts.getTime());
    } catch (NullPointerException e) {
        log.debug(e.getMessage());
    } catch (IllegalArgumentException e) {
        log.debug(e.getMessage());
    }

    return rtnStr;
}

From source file:fr.paris.lutece.portal.web.user.AdminUserJspBeanTest.java

public void testDoModifyAdminUserSuccess() throws AccessDeniedException, UserNotSignedException {
    AdminUser userToModify = getUserToModify();
    try {/*from  w ww.  j a  va  2 s .com*/
        AdminUserJspBean bean = new AdminUserJspBean();
        MockHttpServletRequest request = new MockHttpServletRequest();
        request = new MockHttpServletRequest();
        AdminAuthenticationService.getInstance().registerUser(request, AdminUserHome.findUserByLogin("admin"));
        request.addParameter("id_user", Integer.toString(userToModify.getUserId()));
        final String modifiedName = userToModify.getAccessCode() + "_mod";
        request.addParameter("access_code", modifiedName);
        request.addParameter("last_name", modifiedName);
        request.addParameter("first_name", modifiedName);
        request.addParameter("email", userToModify.getEmail());
        request.addParameter("status", Integer.toString(AdminUser.NOT_ACTIVE_CODE));
        request.addParameter("language", Locale.KOREA.toString());
        request.setParameter(SecurityTokenService.PARAMETER_TOKEN,
                SecurityTokenService.getInstance().getToken(request, "jsp/admin/user/ModifyUser.jsp"));
        bean.doModifyAdminUser(request);
        AdminMessage message = AdminMessageService.getMessage(request);
        assertNull(message);
        AdminUser stored = AdminUserHome.findByPrimaryKey(userToModify.getUserId());
        assertNotNull(stored);
        assertEquals(modifiedName, stored.getAccessCode());
        assertEquals(modifiedName, stored.getFirstName());
        assertEquals(modifiedName, stored.getLastName());
        assertEquals(AdminUser.NOT_ACTIVE_CODE, stored.getStatus());
        assertEquals(Locale.KOREA.toString().toLowerCase(), stored.getLocale().toString().toLowerCase());
    } finally {
        disposeOfUser(userToModify);
    }
}

From source file:fr.paris.lutece.portal.web.user.AdminUserJspBeanTest.java

public void testDoModifyAdminUserNoToken() throws AccessDeniedException, UserNotSignedException {
    AdminUser userToModify = getUserToModify();
    try {/* w w w . ja  va  2 s  .co  m*/
        AdminUserJspBean bean = new AdminUserJspBean();
        MockHttpServletRequest request = new MockHttpServletRequest();
        request = new MockHttpServletRequest();
        AdminAuthenticationService.getInstance().registerUser(request, AdminUserHome.findUserByLogin("admin"));
        request.addParameter("id_user", Integer.toString(userToModify.getUserId()));
        final String modifiedName = userToModify.getAccessCode() + "_mod";
        request.addParameter("access_code", modifiedName);
        request.addParameter("last_name", modifiedName);
        request.addParameter("first_name", modifiedName);
        request.addParameter("email", userToModify.getEmail());
        request.addParameter("status", Integer.toString(AdminUser.NOT_ACTIVE_CODE));
        request.addParameter("language", Locale.KOREA.toString());
        bean.doModifyAdminUser(request);
        fail("Should have thrown ");
    } catch (AccessDeniedException e) {
        AdminUser stored = AdminUserHome.findByPrimaryKey(userToModify.getUserId());
        assertNotNull(stored);
        assertEquals(userToModify.getAccessCode(), stored.getAccessCode());
        assertEquals(userToModify.getFirstName(), stored.getFirstName());
        assertEquals(userToModify.getLastName(), stored.getLastName());
        assertEquals(AdminUser.ACTIVE_CODE, stored.getStatus());
        assertEquals(LocaleService.getDefault(), stored.getLocale());
    } finally {
        disposeOfUser(userToModify);
    }
}

From source file:egovframework.oe1.utl.fcc.service.EgovStringUtil.java

License:asdf

/**
 * ??? ?   ?17??TIMESTAMP?//  w w  w .  j a  v a 2  s .  c o  m
 *  
 * @param
 * @return Timestamp 
 * @exception MyException
 * @see
 */

public static String getTimeStamp() {

    String rtnStr = null;

    // ?    (?--? :::(?? ))
    String pattern = "yyyyMMddhhmmssSSS";

    try {

        SimpleDateFormat sdfCurrent = new SimpleDateFormat(pattern, Locale.KOREA);

        Timestamp ts = new Timestamp(System.currentTimeMillis());

        rtnStr = sdfCurrent.format(ts.getTime());

    } catch (Exception e) {

        log.debug(e.getMessage());

    }

    return rtnStr;
}

From source file:fr.paris.lutece.portal.web.user.AdminUserJspBeanTest.java

public void testDoModifyAdminUserInvalidToken() throws AccessDeniedException, UserNotSignedException {
    AdminUser userToModify = getUserToModify();
    try {//from w  w w  .  j  a  va 2  s .c  om
        AdminUserJspBean bean = new AdminUserJspBean();
        MockHttpServletRequest request = new MockHttpServletRequest();
        request = new MockHttpServletRequest();
        AdminAuthenticationService.getInstance().registerUser(request, AdminUserHome.findUserByLogin("admin"));
        request.addParameter("id_user", Integer.toString(userToModify.getUserId()));
        final String modifiedName = userToModify.getAccessCode() + "_mod";
        request.addParameter("access_code", modifiedName);
        request.addParameter("last_name", modifiedName);
        request.addParameter("first_name", modifiedName);
        request.addParameter("email", userToModify.getEmail());
        request.addParameter("status", Integer.toString(AdminUser.NOT_ACTIVE_CODE));
        request.addParameter("language", Locale.KOREA.toString());
        request.setParameter(SecurityTokenService.PARAMETER_TOKEN,
                SecurityTokenService.getInstance().getToken(request, "jsp/admin/user/ModifyUser.jsp") + "b");
        bean.doModifyAdminUser(request);
        fail("Should have thrown ");
    } catch (AccessDeniedException e) {
        AdminUser stored = AdminUserHome.findByPrimaryKey(userToModify.getUserId());
        assertNotNull(stored);
        assertEquals(userToModify.getAccessCode(), stored.getAccessCode());
        assertEquals(userToModify.getFirstName(), stored.getFirstName());
        assertEquals(userToModify.getLastName(), stored.getLastName());
        assertEquals(AdminUser.ACTIVE_CODE, stored.getStatus());
        assertEquals(LocaleService.getDefault(), stored.getLocale());
    } finally {
        disposeOfUser(userToModify);
    }
}