private void setValue()

in taverna-commandline-common/src/main/java/org/apache/taverna/commandline/data/InputsHandler.java [239:261]


	private void setValue(Path port, Object userInput) throws IOException {
		if (userInput instanceof File) {
			DataBundles.setReference(port, ((File) userInput).toURI());
		} else if (userInput instanceof URL) {
			try {
				DataBundles.setReference(port, ((URL) userInput).toURI());
			} catch (URISyntaxException e) {
				logger.warn(String.format("Error converting %1$s to URI", userInput), e);
			}
		} else if (userInput instanceof String) {
			DataBundles.setStringValue(port, (String) userInput);
		} else if (userInput instanceof byte[]) {
			Files.write(port, (byte[]) userInput, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.CREATE);
		} else if (userInput instanceof List<?>) {
			DataBundles.createList(port);
			List<?> list = (List<?>) userInput;
			for (Object object : list) {
				setValue(DataBundles.newListItem(port), object);
			}
		} else {
			logger.warn("Unknown input type : " + userInput.getClass().getName());
		}
	}