Java Code Examples for org.apache.commons.lang3.ArrayUtils.EMPTY_STRING_ARRAY

The following are Jave code examples for showing how to use EMPTY_STRING_ARRAY of the org.apache.commons.lang3.ArrayUtils class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: oneops   File: NotificationFilter.java   View Source Code Vote up 5 votes
/**
 * Converts the json string to java string array.
 *
 * @param jsonString json array string
 * @return java array. Returns empty string, if there is any error parsing the json string or not of type array.
 */
private static String[] toArray(String jsonString) {
  if (jsonString == null) {
    return ArrayUtils.EMPTY_STRING_ARRAY;
  }
  try {
    return mapper.readValue(jsonString, String[].class);
  } catch (IOException e) {
     return ArrayUtils.EMPTY_STRING_ARRAY;
  }
}
 
Example 2
Project: MMORPG_Prototype   File: ReflectionResourceUtils.java   View Source Code Vote up 5 votes
private static String[] readManifestJars(InputStream in) throws IOException
{
	Manifest manifest = new Manifest(in);
	Attributes attributes = manifest.getMainAttributes();
	String classpath = attributes.getValue(Attributes.Name.CLASS_PATH);
	if(classpath == null)
		return ArrayUtils.EMPTY_STRING_ARRAY;
	System.out.println("Manifest jars: " + classpath);
	return classpath.split(" ");
}
 
Example 3
Project: MMORPG_Prototype   File: ReflectionResourceUtils.java   View Source Code Vote up 5 votes
private static String[] tryReadingFromRootManifest()
{
	try(InputStream in = new FileInputStream("META-INF/MANIFEST.MF"))
	{
		return readManifestJars(in);
	} catch (IOException e)
	{
		e.printStackTrace();
		return ArrayUtils.EMPTY_STRING_ARRAY;
	}
}