Example usage for java.util Locale US

List of usage examples for java.util Locale US

Introduction

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

Prototype

Locale US

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

Click Source Link

Document

Useful constant for country.

Usage

From source file:at.uni_salzburg.cs.ckgroup.pilot.sensor.OpenStreetMapTileCache.java

public File getTile(int zoom, int x, int y) throws IOException {

    String tileCacheFileName = String.format(Locale.US, FORMAT_TILE_CACHE_FILE, tileCacheBaseDir, zoom, x, y);

    File tileCacheFile = new File(tileCacheFileName);

    if (tileCacheFile.exists()) {
        LOG.debug(String.format("Cached tile found for zoom=%d, x=%d, y=%d", zoom, x, y));
        return tileCacheFile;
    }/*www . j  a v a 2 s .c om*/

    String tileCacheDirName = String.format(Locale.US, FORMAT_TILE_CACHE_DIR, tileCacheBaseDir, zoom, x, y);
    File tileCacheDir = new File(tileCacheDirName);
    if (!tileCacheDir.exists()) {
        tileCacheDir.mkdirs();
    }

    String tileDownloadUrl = String.format(Locale.US, tileServerUrl, zoom, x, y);

    LOG.debug(String.format("Downloading tile for zoom=%d, x=%d, y=%d, url=%s", zoom, x, y, tileDownloadUrl));

    downloadFile(tileDownloadUrl, tileCacheFile);

    return tileCacheFile;
}

From source file:com.mercandalli.android.apps.files.file.filespace.FileSpaceModel.java

public FileSpaceModel() {
    mDateFormatGmt = new SimpleDateFormat(DATE_FORMAT, Locale.US);
    mDateFormatGmt.setTimeZone(TimeZone.getTimeZone(UTC));
    mDateFormatLocal = new SimpleDateFormat(DATE_FORMAT, Locale.US);

    mDateFormatGmtMillis = new SimpleDateFormat(DATE_FORMAT_MS, Locale.US);
    mDateFormatGmtMillis.setTimeZone(TimeZone.getTimeZone(UTC));
    mDateFormatLocalMillis = new SimpleDateFormat(DATE_FORMAT_MS, Locale.US);

}

From source file:com.spotify.sdk.android.authentication.sample.MainActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    getSupportActionBar().setTitle(String.format(Locale.US, "Spotify Auth Sample %s",
            com.spotify.sdk.android.authentication.BuildConfig.VERSION_NAME));
}

From source file:at.alladin.rmbt.client.v2.task.result.QoSServerResultDesc.java

/**
 * //  w  w  w .  j  a va 2 s  .  c  o m
 * @param json
 * @throws JSONException
 */
public QoSServerResultDesc(JSONObject json) throws JSONException {
    this.desc = json.getString(JSON_KEY_DESCRIPTION);
    this.testType = QoSTestResultEnum.valueOf(json.getString(JSON_KEY_TESTTYPE));
    this.status = DetailType.valueOf(json.getString(JSON_KEY_STATUS).toUpperCase(Locale.US));
    JSONArray uidArray = json.getJSONArray(JSON_KEY_UID_LIST);
    for (int i = 0; i < uidArray.length(); i++) {
        uidSet.add(uidArray.getLong(i));
    }
}

From source file:cpcc.ros.sim.osm.TileCache.java

/**
 * @param zoom the zoom level/*w w  w  . j  a  v  a2  s .c  om*/
 * @param x the X-coordinate of the tile.
 * @param y the Y-coordinate of the tile.
 * @return the tile as a <code>File</code> object.
 * @throws IOException thrown in case of errors.
 */
@SuppressFBWarnings("PATH_TRAVERSAL_IN")
public File getTile(int zoom, int x, int y) throws IOException {
    String tileCacheFileName = String.format(Locale.US, FORMAT_TILE_CACHE_FILE, tileCacheBaseDir, zoom, x, y);

    File tileCacheFile = new File(tileCacheFileName);

    if (tileCacheFile.exists()) {
        LOG.debug(String.format("Cached tile found for zoom=%d, x=%d, y=%d", zoom, x, y));
        return tileCacheFile;
    }

    String tileCacheDirName = String.format(Locale.US, FORMAT_TILE_CACHE_DIR, tileCacheBaseDir, zoom, x);
    File tileCacheDir = new File(tileCacheDirName);
    if (!tileCacheDir.exists()) {
        FileUtils.forceMkdir(tileCacheDir);
    }

    String tileDownloadUrl = String.format(Locale.US, tileServerUrl, zoom, x, y);

    LOG.debug(String.format("Downloading tile for zoom=%d, x=%d, y=%d, url=%s", zoom, x, y, tileDownloadUrl));

    downloadFile(tileDownloadUrl, tileCacheFile);

    return tileCacheFile;
}

From source file:de.interseroh.report.parameter.BirtConvertingTest.java

@Test
public void testFromStringToDate() throws Exception {
    LocaleContextHolder.setLocale(Locale.US);
    Date converted = conversionService.convert("1/22/15", Date.class);
    assertThat(converted, is(new Date(115, 0, 22)));
}

From source file:at.uni_salzburg.cs.ckgroup.cscpp.mapper.course.WayPoint.java

@Override
public String toString() {
    return String.format(Locale.US, "(%.8f, %.8f, %.3f) precision %.0f velocity %.1f", point.getLatitude(),
            point.getLongitude(), point.getAltitude(), precision, velocity);
}

From source file:ar.com.zauber.garfio.services.impl.HourMinuteTimeConverter.java

/** @see TimeConverter#toHours(String)*/
public final String toHours(final String time) {
    Validate.isTrue(supportsTime(time));

    Matcher m = timePattern.matcher(time);
    m.matches();/*  w ww. ja  v  a2s . c o  m*/
    StringBuilder builder = new StringBuilder();

    if (m.group(1) != null) {
        builder.append(m.group(1));
    }
    if (m.group(3) != null) {
        /* Only hour */
        builder.append(m.group(3));
    } else if (m.group(5) != null || m.group(6) != null) {
        /* [xxh]yym */
        if (m.group(5) != null) {
            builder.append(m.group(5));
        } else {
            builder.append("0");
        }
        if (m.group(6) != null) {
            Formatter f = new Formatter();
            f.format(Locale.US, ".%02.0f", 100 * minutesToHours(Integer.valueOf(m.group(6))));
            builder.append(f.toString());
        }
    } else {
        /* Only minutes >= 60 */
        Formatter f = new Formatter();
        f.format(Locale.US, "%.2f", minutesToHours(Integer.valueOf(m.group(7))));
        builder.append(f.toString());
    }

    return builder.toString();
}

From source file:com.ichi2.libanki.sync.FullSyncer.java

public FullSyncer(Collection col, String hkey, Connection con) {
    super(hkey, con);
    mPostVars = new HashMap<String, Object>();
    mPostVars.put("k", hkey);
    mPostVars.put("v",
            String.format(Locale.US, "ankidroid,%s,%s", VersionUtils.getPkgVersionName(), Utils.platDesc()));
    mCol = col;// www .  j a  va2s.c o m
    mCon = con;
}

From source file:net.sourceforge.js3tream.util.Access.java

/*******************************************************
 * @throws Exception//from www. j  ava  2s . c  om
 ******************************************************/
public Access() throws Exception {
    this.calFormat_ = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.US);
    this.calFormat_.setTimeZone(TimeZone.getTimeZone("GMT"));
    this.mac_ = Mac.getInstance(HMAC_SHA1);
    this.mac_.init(new SecretKeySpec(Access.accessSecret_.getBytes(), HMAC_SHA1));

}