in taverna-server-webapp/src/main/java/org/apache/taverna/server/master/InputREST.java [137:165]
public InDesc setInput(String name, InDesc inputDescriptor, UriInfo ui)
throws NoUpdateException, BadStateChangeException,
FilesystemAccessException, BadInputPortNameException,
BadPropertyValueException {
inputDescriptor.descriptorRef = null;
AbstractContents ac = inputDescriptor.assignment;
if (name == null || name.isEmpty())
throw new BadInputPortNameException("bad input name");
if (ac == null)
throw new BadPropertyValueException("no content!");
if (inputDescriptor.delimiter != null
&& inputDescriptor.delimiter.isEmpty())
inputDescriptor.delimiter = null;
if (ac instanceof InDesc.Reference)
return setRemoteInput(name, (InDesc.Reference) ac,
inputDescriptor.delimiter, ui);
if (!(ac instanceof InDesc.File || ac instanceof InDesc.Value))
throw new BadPropertyValueException("unknown content type");
support.permitUpdate(run);
Input i = support.getInput(run, name);
if (i == null)
i = run.makeInput(name);
if (ac instanceof InDesc.File)
i.setFile(ac.contents);
else
i.setValue(ac.contents);
i.setDelimiter(inputDescriptor.delimiter);
return new InDesc(i, ui);
}