String packaging =
IOUtils.toString( multipartBody.getAttachment( "packaging" ).getDataHandler().getInputStream() );
+ String repositoryId =
+ IOUtils.toString( multipartBody.getAttachment( "repositoryId" ).getDataHandler().getInputStream() );
+
boolean generatePom = BooleanUtils.toBoolean(
IOUtils.toString( multipartBody.getAttachment( "generatePom" ).getDataHandler().getInputStream() ) );
String classifier =
IOUtils.toString( multipartBody.getAttachment( "classifier" ).getDataHandler().getInputStream() );
+ boolean pomFile = BooleanUtils.toBoolean(
+ IOUtils.toString( multipartBody.getAttachment( "pomFile" ).getDataHandler().getInputStream() ) );
+
log.info( "uploading file:" + groupId + ":" + artifactId + ":" + version );
Attachment file = multipartBody.getAttachment( "files[]" );
File tmpFile = File.createTempFile( "upload-artifact", "tmp" );
tmpFile.deleteOnExit();
IOUtils.copy( file.getDataHandler().getInputStream(), new FileOutputStream( tmpFile ) );
FileMetadata fileMetadata = new FileMetadata( "thefile", tmpFile.length(), "theurl" );
+ fileMetadata.setGroupId( groupId );
+ fileMetadata.setArtifactId( artifactId );
+ fileMetadata.setVersion( version );
+ fileMetadata.setVersion( version );
+ fileMetadata.setPackaging( packaging );
+ fileMetadata.setGeneratePom( generatePom );
+ fileMetadata.setClassifier( classifier );
fileMetadata.setDeleteUrl( tmpFile.getName() );
+ fileMetadata.setRepositoryId( repositoryId );
+ fileMetadata.setPomFile( pomFile );
return fileMetadata;
}
catch ( IOException e )
private String errorKey;
+ private String groupId;
+
+ private String artifactId;
+
+ private String version;
+
+ private String packaging;
+
+ private boolean generatePom;
+
+ private String classifier;
+
+ private String repositoryId;
+
+ private boolean pomFile;
+
public FileMetadata()
{
// no op
{
this.deleteType = deleteType;
}
+
+ public String getErrorKey()
+ {
+ return errorKey;
+ }
+
+ public void setErrorKey( String errorKey )
+ {
+ this.errorKey = errorKey;
+ }
+
+ public String getGroupId()
+ {
+ return groupId;
+ }
+
+ public void setGroupId( String groupId )
+ {
+ this.groupId = groupId;
+ }
+
+ public String getArtifactId()
+ {
+ return artifactId;
+ }
+
+ public void setArtifactId( String artifactId )
+ {
+ this.artifactId = artifactId;
+ }
+
+ public String getVersion()
+ {
+ return version;
+ }
+
+ public void setVersion( String version )
+ {
+ this.version = version;
+ }
+
+ public String getPackaging()
+ {
+ return packaging;
+ }
+
+ public void setPackaging( String packaging )
+ {
+ this.packaging = packaging;
+ }
+
+ public boolean isGeneratePom()
+ {
+ return generatePom;
+ }
+
+ public void setGeneratePom( boolean generatePom )
+ {
+ this.generatePom = generatePom;
+ }
+
+ public String getClassifier()
+ {
+ return classifier;
+ }
+
+ public void setClassifier( String classifier )
+ {
+ this.classifier = classifier;
+ }
+
+ public String getRepositoryId()
+ {
+ return repositoryId;
+ }
+
+ public void setRepositoryId( String repositoryId )
+ {
+ this.repositoryId = repositoryId;
+ }
+
+ public boolean isPomFile()
+ {
+ return pomFile;
+ }
+
+ public void setPomFile( boolean pomFile )
+ {
+ this.pomFile = pomFile;
+ }
}
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-upload">
<td class="name"><span>{%=file.name%}</span></td>
- <td><input type="text" id="classifier" name="classifier" placeholder="classifier" value=""></td>
+ <td><input type="text" id="classifier" name="classifier" placeholder="classifier" value=""/></td>
+ <td><span>pomFile:</span><input type="checkbox" id="pomFile" name="pomFile"/></td>
<td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
{% if (file.error) { %}
<td class="error" colspan="2">