mirror of https://github.com/apache/archiva.git
transfer more informations for file uploading: maven coordinate
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1307154 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f832e697a0
commit
a5721cffba
|
@ -88,19 +88,34 @@ public class DefaultFileUploadService
|
|||
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 )
|
||||
|
|
|
@ -41,6 +41,22 @@ public class FileMetadata
|
|||
|
||||
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
|
||||
|
@ -105,4 +121,94 @@ public class FileMetadata
|
|||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -94,7 +94,8 @@
|
|||
{% 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">
|
||||
|
|
Loading…
Reference in New Issue