/*** * Concatenate filename, checksum, source cmroot uri and subdirectory with "#" * @param fileUriStr Filename string * @param fileChecksum Checksum string * @param encodedSubDir sub directory path into which this file belongs to. Here encoded means, * the multiple levels of subdirectories are concatenated with path separator "/" * @return Concatenated Uri string */ // TODO: this needs to be enhanced once change management based filesystem is implemented // Currently using fileuri#checksum#cmrooturi#subdirs as the format public static String encodeFileUri(String fileUriStr, String fileChecksum, String encodedSubDir) throws IOException { String encodedUri = fileUriStr; if ((fileChecksum != null) && (cmroot != null)) { encodedUri = encodedUri + URI_FRAGMENT_SEPARATOR + fileChecksum + URI_FRAGMENT_SEPARATOR + FileUtils.makeQualified(cmroot, conf); } else { encodedUri = encodedUri + URI_FRAGMENT_SEPARATOR + URI_FRAGMENT_SEPARATOR; } encodedUri = encodedUri + URI_FRAGMENT_SEPARATOR + ((encodedSubDir != null) ? encodedSubDir : ""); LOG.debug("Encoded URI: " + encodedUri); return encodedUri; }