try {
File marketDirectory = new File(attachment);
File fileToUpload = findFileToUpload(marketDirectory);
if (fileToUpload != null) {
MarketPlaceFile pluginFile = drupal.postFile(cS, userid, marketDirectory.getAbsolutePath(), fileToUpload.getName());
plugin.addFile(pluginFile);
drupal.putPlugin(cS, nodeid, plugin);
} else {
throw new BuildException("No marketplace files in folder " + marketDirectory);