/*** * Split uri with fragment into file uri, subdirs, checksum and source cmroot uri. * Currently using fileuri#checksum#cmrooturi#subdirs as the format. * @param fileURIStr uri with fragment * @return array of file name, subdirs, checksum and source CM root URI */ public static String[] decodeFileUri(String fileURIStr) { String[] uriAndFragment = fileURIStr.split(URI_FRAGMENT_SEPARATOR); String[] result = new String[4]; result[0] = uriAndFragment[0]; if ((uriAndFragment.length > 1) && !StringUtils.isEmpty(uriAndFragment[1])) { result[1] = uriAndFragment[1]; } if ((uriAndFragment.length > 2) && !StringUtils.isEmpty(uriAndFragment[2])) { result[2] = uriAndFragment[2]; } if ((uriAndFragment.length > 3) && !StringUtils.isEmpty(uriAndFragment[3])) { result[3] = uriAndFragment[3]; } LOG.debug("Reading Encoded URI: " + result[0] + ":: " + result[1] + ":: " + result[2] + ":: " + result[3]); return result; }
public static boolean isSourceOfReplication(Database db) { assert (db != null); String replPolicyIds = getReplPolicyIdString(db); return !StringUtils.isEmpty(replPolicyIds); }