@Test public void getPathWithoutSchemaTest() { List<String> schemas = new ArrayList<String>(); schemas.add(""); schemas.add("tachyon: schemas.add("tachyon-ft: schemas.add("tachyon: schemas.add("tachyon-ft: schemas.add("tachyon: schemas.add("tachyon-ft: for (int k = 0; k < schemas.size(); k ++) { String schema = schemas.get(k); if (!schema.equals("")) { Assert.assertEquals("/", CommonUtils.getPathWithoutSchema(schema)); } Assert.assertEquals("/", CommonUtils.getPathWithoutSchema(schema + "/")); Assert.assertEquals("/123", CommonUtils.getPathWithoutSchema(schema + "/123")); Assert.assertEquals("/ab/de.txt", CommonUtils.getPathWithoutSchema(schema + "/ab/de.txt")); } }
public static String getPathWithoutSchema(String path) { if (!path.contains(": return path; } path = path.substring(path.indexOf(": if (!path.contains(Constants.PATH_SEPARATOR)) { return Constants.PATH_SEPARATOR; } return path.substring(path.indexOf(Constants.PATH_SEPARATOR)); }
CommonUtils { public static String getPathWithoutSchema(String path) { if (!path.contains(": return path; } path = path.substring(path.indexOf(": if (!path.contains(Constants.PATH_SEPARATOR)) { return Constants.PATH_SEPARATOR; } return path.substring(path.indexOf(Constants.PATH_SEPARATOR)); } }
CommonUtils { public static String getPathWithoutSchema(String path) { if (!path.contains(": return path; } path = path.substring(path.indexOf(": if (!path.contains(Constants.PATH_SEPARATOR)) { return Constants.PATH_SEPARATOR; } return path.substring(path.indexOf(Constants.PATH_SEPARATOR)); }  }
CommonUtils { public static String getPathWithoutSchema(String path) { if (!path.contains(": return path; } path = path.substring(path.indexOf(": if (!path.contains(Constants.PATH_SEPARATOR)) { return Constants.PATH_SEPARATOR; } return path.substring(path.indexOf(Constants.PATH_SEPARATOR)); }  static String addLeadingZero(int number, int width); static void changeLocalFilePermission(String filePath, String perms); static void changeLocalFileToFullPermission(String filePath); static String cleanPath(String path); static ByteBuffer cloneByteBuffer(ByteBuffer buf); static List<ByteBuffer> cloneByteBufferList(List<ByteBuffer> source); static String concat(Object... args); static String convertByteArrayToStringWithoutEscape(byte[] data); static String convertMsToClockTime(long Millis); static String convertMsToDate(long Millis); static String convertMsToShortClockTime(long Millis); static String convertMsToSimpleDate(long Millis); static ByteBuffer generateNewByteBufferFromThriftRPCResults(ByteBuffer data); static long getBlockIdFromFileName(String name); static long getCurrentMs(); static long getCurrentNs(); static long getMB(long bytes); static String getName(String path); static String getParent(String path); static String[] getPathComponents(String path); static String getPathWithoutSchema(String path); static String getSizeFromBytes(long bytes); static void illegalArgumentException(Exception e); static void illegalArgumentException(String msg); static boolean isRoot(String path); static String listToString(List<T> list); static String parametersToString(Object... objs); static InetSocketAddress parseInetSocketAddress(String address); static long parseSpaceSize(String spaceSize); static void printByteBuffer(Logger LOG, ByteBuffer buf); static void printTimeTakenMs(long startTimeMs, Logger logger, String message); static void printTimeTakenNs(long startTimeNs, Logger logger, String message); static void runtimeException(Exception e); static void runtimeException(String msg); static void setLocalFileStickyBit(String file); static void sleepMs(Logger logger, long timeMs); static void tempoaryLog(String msg); static String[] toStringArray(ArrayList<String> src); static void touch(String path); static void validatePath(String path); }
CommonUtils { public static String getPathWithoutSchema(String path) { if (!path.contains(": return path; } path = path.substring(path.indexOf(": if (!path.contains(Constants.PATH_SEPARATOR)) { return Constants.PATH_SEPARATOR; } return path.substring(path.indexOf(Constants.PATH_SEPARATOR)); }  static String addLeadingZero(int number, int width); static void changeLocalFilePermission(String filePath, String perms); static void changeLocalFileToFullPermission(String filePath); static String cleanPath(String path); static ByteBuffer cloneByteBuffer(ByteBuffer buf); static List<ByteBuffer> cloneByteBufferList(List<ByteBuffer> source); static String concat(Object... args); static String convertByteArrayToStringWithoutEscape(byte[] data); static String convertMsToClockTime(long Millis); static String convertMsToDate(long Millis); static String convertMsToShortClockTime(long Millis); static String convertMsToSimpleDate(long Millis); static ByteBuffer generateNewByteBufferFromThriftRPCResults(ByteBuffer data); static long getBlockIdFromFileName(String name); static long getCurrentMs(); static long getCurrentNs(); static long getMB(long bytes); static String getName(String path); static String getParent(String path); static String[] getPathComponents(String path); static String getPathWithoutSchema(String path); static String getSizeFromBytes(long bytes); static void illegalArgumentException(Exception e); static void illegalArgumentException(String msg); static boolean isRoot(String path); static String listToString(List<T> list); static String parametersToString(Object... objs); static InetSocketAddress parseInetSocketAddress(String address); static long parseSpaceSize(String spaceSize); static void printByteBuffer(Logger LOG, ByteBuffer buf); static void printTimeTakenMs(long startTimeMs, Logger logger, String message); static void printTimeTakenNs(long startTimeNs, Logger logger, String message); static void runtimeException(Exception e); static void runtimeException(String msg); static void setLocalFileStickyBit(String file); static void sleepMs(Logger logger, long timeMs); static void tempoaryLog(String msg); static String[] toStringArray(ArrayList<String> src); static void touch(String path); static void validatePath(String path);  }