Returns the URL represented by <code>str</code>.

@param str the URL string
@return The URL in <code>str</code> is well-formed
@throws ParseException if the URL in <code>str</code> is not well-formed
338977
public static URL createURL(String str) throws ParseException
    {
        try
        {
            return new URL(str);
        }
        catch (MalformedURLException e)
        {
            throw new ParseException("Unable to parse the URL: " + str);
        }
    }
291148
public static Float parseFloat(final String str) {
        if (null != str) {
            try {
                return new Float(Float.parseFloat(str.trim()));
            } catch (final Exception e) {
                // :IGNORE:
            }
        }
        return null;
    }
1114814
public static String getText(URL url) throws IOException {
        return getText(url, CharsetToolkit.getDefaultSystemCharset().name());
    }
1092206
public static String stringByDeletingLastPathComponent(final String str) {
        String path = str;
        int start = str.length() - 1;
        while (path.charAt(start) == '/') { start--; }

        final int index = path.lastIndexOf('/', start);
        path = (index < 0) ? "" : path.substring(0, index);


        if (path.length() == 0 && str.charAt(0) == '/') { return "/"; }

        return path;
    }
1050188
public static Long parseLong(final String str) {
        if (null != str) {
            try {
                return new Long(Long.parseLong(str.trim()));
            } catch (final Exception e) {
                // :IGNORE:
            }
        }
        return null;
    }
1063659
public static String encode(String str)
	{
		try
		{
			return java.net.URLEncoder.encode(str, "UTF-8");
		}
		catch(java.io.UnsupportedEncodingException ue)
		{
			return str;
		}
	}
1159600
public JBBPTextWriter Str(final String... str) throws IOException {
    JBBPUtils.assertNotNull(str, "String must not be null");

    final String oldPrefix = this.prefixValue;
    final String oldPostfix = this.postfixValue;
    this.prefixValue = "";
    this.postfixValue = "";

    for (final String s : str) {
      ensureValueMode();
      printValueString(s == null ? "<NULL>" : s);
    }

    this.prefixValue = oldPrefix;
    this.postfixValue = oldPostfix;
    return this;
  }
633924
public static String readStringFromUrlGeneric(String url)
            throws IOException {
        InputStream is = null;
        URL urlObj = null;
        String responseString = PcConstants.NA;
        try {
            urlObj = new URL(url);
            URLConnection con = urlObj.openConnection();

            con.setConnectTimeout(ParallecGlobalConfig.urlConnectionConnectTimeoutMillis);
            con.setReadTimeout(ParallecGlobalConfig.urlConnectionReadTimeoutMillis);
            is = con.getInputStream();

            BufferedReader rd = new BufferedReader(new InputStreamReader(is,
                    Charset.forName("UTF-8")));
            responseString = PcFileNetworkIoUtils.readAll(rd);

        } finally {

            if (is != null) {
                is.close();
            }

        }

        return responseString;
    }
324429
public static PushSubscription fromString(String str) {
        if (str == null || str.isEmpty()) {
            throw new IllegalArgumentException("Cannot create a stream from an empty or null string");
        }
        PushSubscription stream = new PushSubscription();
        stream.id = str;
        return stream;
    }
1088755
public static String trim(String str) {
		return str != null && str.length() > 0 ? str.trim() : str;
	}
788056
public static URL getUrl(String url) {
    try {
      return new URL(url);
    } catch (MalformedURLException e) {
      throw new RuntimeException(e);
    }
  }
939159
public static URL read(String string) {
		try {
			return new URL(string);
		} catch (MalformedURLException e) {
			e.printStackTrace();
			return null;
		}
	}
1232281
public static Number createNumber(String str) throws ParseException
    {
        try
        {
            if (str.indexOf('.') != -1)
            {
                return Double.valueOf(str);
            }
            return Long.valueOf(str);
        }
        catch (NumberFormatException e)
        {
            throw new ParseException(e.getMessage());
        }
    }
1240759
public Date parseDateOrDatetime(String str) {
        if (str == null)
            return null;
        else if (str.length() <= dateLength)
            return parseDate(str);
        else
            return parseDatetime(str);
    }
353028
private static Type doParse(String str) throws Exception {
        Class<?> token = PRIMITIVES.get(str);
        if (token != null) {
            return token;
        }
        int first = str.indexOf('<');
        if (first < 0) {
            return StringConvert.loadType(str);
        }
        int last = str.lastIndexOf('>');
        String baseStr = str.substring(0, first);
        Class<?> base = StringConvert.loadType(baseStr);
        String argsStr = str.substring(first + 1, last);
        List<String> splitArgs = split(argsStr);
        List<Type> types = new ArrayList<Type>();
        for (String splitArg : splitArgs) {
            Type argType;
            if (splitArg.startsWith(EXTENDS)) {
                String remainder = splitArg.substring(EXTENDS.length());
                argType = wildExtendsType(doParse(remainder));
            } else if (splitArg.startsWith(SUPER)) {
                String remainder = splitArg.substring(SUPER.length());
                argType = wildSuperType(doParse(remainder));
            } else if (splitArg.equals("?")) {
                argType = wildExtendsType(Object.class);
            } else if (splitArg.endsWith("[]")) {
                String componentStr = splitArg.substring(0, splitArg.length() - 2);
                Class<?> componentCls = StringConvert.loadType(componentStr);
                argType = Array.newInstance(componentCls, 0).getClass();
            } else if (splitArg.startsWith("[L") && splitArg.endsWith(";")) {
                String componentStr = splitArg.substring(2, splitArg.length() - 1);
                Class<?> componentCls = StringConvert.loadType(componentStr);
                argType = Array.newInstance(componentCls, 0).getClass();
            } else {
                argType = doParse(splitArg);
            }
            types.add(argType);
        }
        return newParameterizedType(base, types.toArray(new Type[types.size()]));
    }
566238
public static String getPrettyFormatted(String str) {
        return String.format("%s-%s-%s-%s-%s", new Object[] { str.substring(0, 8), str.substring(8, 12), str.substring(12, 16), str.substring(16, 20), str.substring(20) });
    }
1292539
public static String decode(String str) {
    if (str != null) {
      try {
        return URLDecoder.decode(str, UTF_8.name());
      } catch (UnsupportedEncodingException e) {
        throw new RuntimeException("JVM must support UTF-8", e);
      }
    }
    return null;
  }