protected ArchiveReader getArchiveReader(final URL u) throws IOException { // If url represents a local file then return file it points to. if (u.getPath() != null) { // TODO: Add scheme check and host check. File f = new File(u.getPath()); if (f.exists()) { return get(f, 0); } } String scheme = u.getProtocol(); if (scheme.startsWith("http") || scheme.equals("s3")) { // Try streaming if http or s3 URLs rather than copying local // and then reading (Passing an offset will get us an Reader // that wraps a Stream). return get(u, 0); } return makeARCLocal(u.openConnection()); }
protected ArchiveReader getArchiveReader(final URL u) throws IOException { // If url represents a local file then return file it points to. if (u.getPath() != null) { // TODO: Add scheme check and host check. File f = new File(u.getPath()); if (f.exists()) { return get(f, 0); } } String scheme = u.getProtocol(); if (scheme.startsWith("http") || scheme.equals("s3")) { // Try streaming if http or s3 URLs rather than copying local // and then reading (Passing an offset will get us an Reader // that wraps a Stream). return get(u, 0); } return makeARCLocal(u.openConnection()); }
protected ArchiveReader getArchiveReader(final URL u) throws IOException { // If url represents a local file then return file it points to. if (u.getPath() != null) { // TODO: Add scheme check and host check. File f = new File(u.getPath()); if (f.exists()) { return get(f, 0); } } String scheme = u.getProtocol(); if (scheme.startsWith("http") || scheme.equals("s3")) { // Try streaming if http or s3 URLs rather than copying local // and then reading (Passing an offset will get us an Reader // that wraps a Stream). return get(u, 0); } return makeARCLocal(u.openConnection()); }