@Override public int run(CommandLine cl) throws AlluxioException, IOException { String[] args = cl.getArgs(); String ttl = CommonUtils.stripLeadingAndTrailingQuotes(args[1]); mTtlMs = FileSystemShellUtils.getMs(ttl); AlluxioURI path = new AlluxioURI(args[0]); runWildCardCmd(path, cl); return 0; }
@Test public void stripLeadingAndTrailingQuotes() throws Exception { assertEquals("", CommonUtils.stripLeadingAndTrailingQuotes("")); assertEquals("\"", CommonUtils.stripLeadingAndTrailingQuotes("\"")); assertEquals("", CommonUtils.stripLeadingAndTrailingQuotes("\"\"")); assertEquals("\"", CommonUtils.stripLeadingAndTrailingQuotes("\"\"\"")); assertEquals("\"\"", CommonUtils.stripLeadingAndTrailingQuotes("\"\"\"\"")); assertEquals("noquote", CommonUtils.stripLeadingAndTrailingQuotes("noquote")); assertEquals( "\"singlequote", CommonUtils.stripLeadingAndTrailingQuotes("\"singlequote")); assertEquals( "singlequote\"", CommonUtils.stripLeadingAndTrailingQuotes("singlequote\"")); assertEquals("quoted", CommonUtils.stripLeadingAndTrailingQuotes("\"quoted\"")); assertEquals("\"quoted\"", CommonUtils.stripLeadingAndTrailingQuotes("\"\"quoted\"\"")); }