public static File getValidatedFile()

in taverna-server-worker/src/main/java/org/apache/taverna/server/localworker/impl/utils/FilenameVerifier.java [108:130]


	public static File getValidatedFile(File dir, String... names)
			throws IOException {
		if (names.length == 0)
			throw new IOException("empty filename");
		File f = dir;
		for (String name : names) {
			String low = name.toLowerCase();
			if (ILLEGAL_NAMES.contains(low))
				throw new IOException("illegal filename");
			for (char c : ILLEGAL_CHARS)
				if (low.indexOf(c) >= 0)
					throw new IOException("illegal filename");
			for (String s : ILLEGAL_PREFIXES)
				if (low.startsWith(s))
					throw new IOException("illegal filename");
			for (String s : ILLEGAL_SUFFIXES)
				if (low.endsWith(s))
					throw new IOException("illegal filename");
			f = new File(f, name);
		}
		assert f != null;
		return f;
	}