if (file != null) {
try {
item.write(file);
} catch (Exception e) {
throw new PortletException(e);
}
}
// This is not the file itself, but one of the form fields for the URI
} else {
String fieldName = item.getFieldName().trim();
if ("group".equals(fieldName)) {
group = item.getString().trim();
} else if ("artifact".equals(fieldName)) {
artifact = item.getString().trim();
} else if ("version".equals(fieldName)) {
version = item.getString().trim();
} else if ("fileType".equals(fieldName)) {
fileType = item.getString().trim();
}
}
}
repo.copyToRepository(file, new Artifact(group, artifact, version, fileType), new FileWriteMonitor() {
public void writeStarted(String fileDescription, int fileSize) {
log.info("Copying into repository " + fileDescription + "...");
}
public void writeProgress(int bytes) {
}
public void writeComplete(int bytes) {
log.info("Finished.");
}
});
} catch (FileUploadException e) {
throw new PortletException(e);
}
} catch (PortletException e) {
throw e;
}
}