return null;
}
public String uploadFile( FormData uploadItem ) throws IOException {
InputStream fileData = uploadItem.getFile().getInputStream();
GAV gav = uploadItem.getGav();
try {
if ( gav == null ) {
if ( !fileData.markSupported() ) {
fileData = new BufferedInputStream( fileData );
}
fileData.mark( fileData.available() ); // is available() safe?
String pomContent = GuvnorM2Repository.loadPOMFromJar(fileData);
PomModel pomModel = null;
if ( pomContent != null ) {
pomModel = PomModel.Parser.parse("pom.xml", new ByteArrayInputStream(pomContent.getBytes()));
}
if ( pomModel != null ) {
String groupId = pomModel.getReleaseId().getGroupId();
String artifactId = pomModel.getReleaseId().getArtifactId();
String version = pomModel.getReleaseId().getVersion();
if (isNullOrEmpty(groupId) || isNullOrEmpty(artifactId) || isNullOrEmpty(version)) {
return NO_VALID_POM;
} else {
gav = new GAV(groupId, artifactId, version);
}
} else {
return NO_VALID_POM;
}