/** * Specifies a set of search paths. */ public T searchPath(File... searchPath) { for (File file : searchPath) { addPath(file); } return (T) this; }
/** * Specifies single search path. */ public T searchPath(File searchPath) { addPath(searchPath); return (T) this; }
/** * Specifies a set of search paths. */ public FindFile searchPath(final File... searchPath) { for (File file : searchPath) { addPath(file); } return this; }
/** * Specifies single search path. */ public FindFile searchPath(final File searchPath) { addPath(searchPath); return this; }
/** * Specifies the search path. Throws an exception if URI is invalid. */ public T searchPath(URI searchPath) { File file; try { file = new File(searchPath); } catch (Exception ex) { throw new FindFileException("URI error: " + searchPath, ex); } addPath(file); return (T) this; }
/** * Specifies the search path. If provided path contains * {@link File#pathSeparator} than string will be tokenized * and each part will be added separately as a search path. */ public T searchPath(String searchPath) { if (searchPath.indexOf(File.pathSeparatorChar) != -1) { String[] paths = StringUtil.split(searchPath, File.pathSeparator); for (String path : paths) { addPath(new File(path)); } } else { addPath(new File(searchPath)); } return (T) this; }
/** * Specifies the search path. If provided path contains * {@link File#pathSeparator} than string will be tokenized * and each part will be added separately as a search path. */ public FindFile searchPath(final String searchPath) { if (searchPath.indexOf(File.pathSeparatorChar) != -1) { String[] paths = StringUtil.split(searchPath, File.pathSeparator); for (String path : paths) { addPath(new File(path)); } } else { addPath(new File(searchPath)); } return this; }
/** * Specifies the search path. Throws an exception if URI is invalid. */ public FindFile searchPath(final URI searchPath) { File file; try { file = new File(searchPath); } catch (Exception ex) { throw new FindFileException("URI error: " + searchPath, ex); } addPath(file); return this; }
/** * Specifies the search path. Throws an exception if URL is invalid. */ public T searchPath(URL searchPath) { File file = FileUtil.toFile(searchPath); if (file == null) { throw new FindFileException("URL error: " + searchPath); } addPath(file); return (T) this; }
/** * Specifies the search path. Throws an exception if URL is invalid. */ public FindFile searchPath(final URL searchPath) { File file = FileUtil.toContainerFile(searchPath); if (file == null) { throw new FindFileException("URL error: " + searchPath); } addPath(file); return this; }
/** * Specifies a set of search paths. */ public FindFile searchPath(final File... searchPath) { for (File file : searchPath) { addPath(file); } return this; }
/** * Specifies single search path. */ public FindFile searchPath(final File searchPath) { addPath(searchPath); return this; }
/** * Specifies the search path. If provided path contains * {@link File#pathSeparator} than string will be tokenized * and each part will be added separately as a search path. */ public FindFile searchPath(final String searchPath) { if (searchPath.indexOf(File.pathSeparatorChar) != -1) { String[] paths = StringUtil.split(searchPath, File.pathSeparator); for (String path : paths) { addPath(new File(path)); } } else { addPath(new File(searchPath)); } return this; }
/** * Specifies the search path. Throws an exception if URI is invalid. */ public FindFile searchPath(final URI searchPath) { File file; try { file = new File(searchPath); } catch (Exception ex) { throw new FindFileException("URI error: " + searchPath, ex); } addPath(file); return this; }
/** * Specifies the search path. Throws an exception if URL is invalid. */ public FindFile searchPath(final URL searchPath) { File file = FileUtil.toContainerFile(searchPath); if (file == null) { throw new FindFileException("URL error: " + searchPath); } addPath(file); return this; }