Java URI Create createExtensionUri(final String ext)

Here you can find the source of createExtensionUri(final String ext)

Description

Static helper to construct appropriate URIs for file-extensions format specifiers.

License

Open Source License

Parameter

Parameter Description
ext The extension (e.g. 'txt')

Return

the extension as a format URI

Declaration

static URI createExtensionUri(final String ext) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2007, 2010 The Planets Project Partners.
 *
 * All rights reserved. This program and the accompanying 
 * materials are made available under the terms of the 
 * Apache License, Version 2.0 which accompanies 
 * this distribution, and is available at 
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 *******************************************************************************/

import java.net.URI;

public class Main {
    /** The prefix for extension format URIs. */
    static final String EXT_URI_PREFIX = "planets:fmt/ext/";

    /**/*from  w w  w  . j a  va  2  s . co  m*/
     * Static helper to construct appropriate URIs for file-extensions format
     * specifiers.
     * @param ext The extension (e.g. 'txt')
     * @return the extension as a format URI
     */
    static URI createExtensionUri(final String ext) {
        return URI.create(EXT_URI_PREFIX + ext.toLowerCase());
    }
}

Related

  1. create(final String uri)
  2. createAbsoluteURI(URI base, String uri)
  3. createConnection(final String uri, final String authValue)
  4. createDatastream(String registrationUri, String APIKey, String xmlDescription)
  5. createDefaultName(final String uri)
  6. createURI()
  7. createUri(File file)
  8. createURI(final String file)
  9. createUri(final String path)