public static boolean isFileUri(String value) { try { return UriType.FILE == getURLType(createURI(value)); } catch (URISyntaxException ex) { throw new RuntimeException(ex); } }
public static boolean isIvyUri(String value) throws URISyntaxException { return UriType.IVY == getURLType(createURI(value)); }
public static boolean isHdfsUri(String value) throws URISyntaxException { return UriType.HDFS == getURLType(createURI(value)); }
private List<URI> resolveAndDownloadInternal(URI source, String subDir, boolean convertToUnix, boolean isLocalAllowed) throws URISyntaxException, IOException { switch (getURLType(source)) { case FILE: return isLocalAllowed ? Collections.singletonList(source) : null; case IVY: return dependencyResolver.downloadDependencies(source); case HDFS: case OTHER: return Collections.singletonList(createURI(downloadResource(source, subDir, convertToUnix))); default: throw new AssertionError(getURLType(source)); } }
private List<URI> resolveAndDownloadInternal(URI source, String subDir, boolean convertToUnix, boolean isLocalAllowed) throws URISyntaxException, IOException { switch (getURLType(source)) { case FILE: return isLocalAllowed ? Lists.newArrayList(source) : null; case IVY: return dependencyResolver.downloadDependencies(source); case OTHER: return Lists.newArrayList( createURI(downloadResource(source, subDir, convertToUnix))); default: throw new AssertionError(getURLType(source)); } }