TikaResourceHelper { static final InputStream[] streamsFromUrls(final List<URL> urls) throws IOException { InputStream[] streams = new InputStream[urls.size()]; int strInd = 0; for (URL url : urls) { streams[strInd++] = url.openStream(); } return streams; } private  TikaResourceHelper();  final static String TIKA_MIMETYPES; final static String CUSTOM_MIMETYPES; }
@SuppressWarnings("javadoc") @Test public final void testStreamsFromUrls() throws URISyntaxException, IOException { List<URL> custSigUrls = new ArrayList<URL>(); for (File csFile : AllFidgetTests.getCustomSigTestFile()) { custSigUrls.add(csFile.toURI().toURL()); } List<String> sigUrlHashes = new ArrayList<String>(); for (URL sigUrl : custSigUrls) { InputStream urlStr = sigUrl.openStream(); sigUrlHashes.add(TikaIdentifier.hash64K(urlStr)); urlStr.close(); } InputStream[] custSigStreams = TikaResourceHelper.streamsFromUrls(custSigUrls); List<String> sigStrHashes = new ArrayList<String>(); for (InputStream sigStr : custSigStreams) { sigStrHashes.add(TikaIdentifier.hash64K(sigStr)); } assertTrue("Expected some test data", sigStrHashes.size() > 0); assertTrue("Hash lists should be equal", sigUrlHashes.equals(sigStrHashes)); }