@Service(value="fileUploadService#rest") public class DefaultFileUploadService extends AbstractRestService implements FileUploadService
Modifier and Type | Field and Description |
---|---|
private ChecksumAlgorithm[] |
algorithms |
private ArchivaAdministration |
archivaAdministration |
private String |
FS |
private javax.servlet.http.HttpServletRequest |
httpServletRequest |
private org.slf4j.Logger |
log |
private ManagedRepositoryAdmin |
managedRepositoryAdmin |
private RepositoryContentFactory |
repositoryFactory |
private ArchivaTaskScheduler |
scheduler |
config, httpServletResponse, proxyConnectorAdmin, repositoryContentFactory, repositorySessionFactory, repositoryTaskScheduler, userRepositories
FILES_SESSION_KEY
Constructor and Description |
---|
DefaultFileUploadService() |
Modifier and Type | Method and Description |
---|---|
private void |
checkParamChars(String param,
String value) |
Boolean |
clearUploadedFiles() |
private void |
copyFile(File sourceFile,
File targetPath,
String targetFilename,
boolean fixChecksums) |
private File |
createPom(File targetPath,
String filename,
FileMetadata fileMetadata,
String groupId,
String artifactId,
String version,
String packaging) |
Boolean |
deleteFile(String fileName) |
private void |
fixChecksums(File file) |
private ArchivaRepositoryMetadata |
getMetadata(File metadataFile) |
List<FileMetadata> |
getSessionFileMetadatas() |
protected List<FileMetadata> |
getSessionFilesList()
FIXME must be per session synchronized not globally
|
private String |
getStringValue(org.apache.cxf.jaxrs.ext.multipart.MultipartBody multipartBody,
String attachmentId) |
private boolean |
hasValidChars(String checkString) |
FileMetadata |
post(org.apache.cxf.jaxrs.ext.multipart.MultipartBody multipartBody) |
private void |
queueRepositoryTask(String repositoryId,
File localFile) |
Boolean |
save(String repositoryId,
String groupId,
String artifactId,
String version,
String packaging,
boolean generatePom) |
protected void |
saveFile(String repositoryId,
FileMetadata fileMetadata,
boolean generatePom,
String groupId,
String artifactId,
String version,
String packaging) |
protected void |
savePomFile(String repositoryId,
FileMetadata fileMetadata,
String groupId,
String artifactId,
String version,
String packaging) |
private void |
updateProjectMetadata(String targetPath,
Date lastUpdatedTimestamp,
String timestamp,
int buildNumber,
boolean fixChecksums,
FileMetadata fileMetadata,
String groupId,
String artifactId,
String version,
String packaging)
Update artifact level metadata.
|
private void |
updateVersionMetadata(ArchivaRepositoryMetadata metadata,
File metadataFile,
Date lastUpdatedTimestamp,
String timestamp,
int buildNumber,
boolean fixChecksums,
FileMetadata fileMetadata,
String groupId,
String artifactId,
String version,
String packaging)
Update version level metadata for snapshot artifacts.
|
buildArtifacts, doScanRepository, getArtifactUrl, getArtifactUrl, getAuditInformation, getAuditListeners, getBaseUrl, getBeansOfType, getModelMapper, getObservableRepos, getPrincipal, setAuditListeners, triggerAuditEvent
private org.slf4j.Logger log
@Context private javax.servlet.http.HttpServletRequest httpServletRequest
@Inject private ManagedRepositoryAdmin managedRepositoryAdmin
@Inject private RepositoryContentFactory repositoryFactory
@Inject private ArchivaAdministration archivaAdministration
private ChecksumAlgorithm[] algorithms
@Inject @Named(value="archivaTaskScheduler#repository") private ArchivaTaskScheduler scheduler
public DefaultFileUploadService()
private String getStringValue(org.apache.cxf.jaxrs.ext.multipart.MultipartBody multipartBody, String attachmentId) throws IOException
IOException
public FileMetadata post(org.apache.cxf.jaxrs.ext.multipart.MultipartBody multipartBody) throws ArchivaRestServiceException
post
in interface FileUploadService
ArchivaRestServiceException
protected List<FileMetadata> getSessionFilesList()
public Boolean deleteFile(String fileName) throws ArchivaRestServiceException
deleteFile
in interface FileUploadService
ArchivaRestServiceException
public Boolean clearUploadedFiles() throws ArchivaRestServiceException
clearUploadedFiles
in interface FileUploadService
ArchivaRestServiceException
public List<FileMetadata> getSessionFileMetadatas() throws ArchivaRestServiceException
getSessionFileMetadatas
in interface FileUploadService
ArchivaRestServiceException
private boolean hasValidChars(String checkString)
private void checkParamChars(String param, String value) throws ArchivaRestServiceException
ArchivaRestServiceException
public Boolean save(String repositoryId, String groupId, String artifactId, String version, String packaging, boolean generatePom) throws ArchivaRestServiceException
save
in interface FileUploadService
ArchivaRestServiceException
protected void savePomFile(String repositoryId, FileMetadata fileMetadata, String groupId, String artifactId, String version, String packaging) throws ArchivaRestServiceException
ArchivaRestServiceException
protected void saveFile(String repositoryId, FileMetadata fileMetadata, boolean generatePom, String groupId, String artifactId, String version, String packaging) throws ArchivaRestServiceException
ArchivaRestServiceException
private ArchivaRepositoryMetadata getMetadata(File metadataFile) throws RepositoryMetadataException
RepositoryMetadataException
private File createPom(File targetPath, String filename, FileMetadata fileMetadata, String groupId, String artifactId, String version, String packaging) throws IOException
IOException
private void fixChecksums(File file)
private void queueRepositoryTask(String repositoryId, File localFile)
private void copyFile(File sourceFile, File targetPath, String targetFilename, boolean fixChecksums) throws IOException
IOException
private void updateProjectMetadata(String targetPath, Date lastUpdatedTimestamp, String timestamp, int buildNumber, boolean fixChecksums, FileMetadata fileMetadata, String groupId, String artifactId, String version, String packaging) throws RepositoryMetadataException
RepositoryMetadataException
private void updateVersionMetadata(ArchivaRepositoryMetadata metadata, File metadataFile, Date lastUpdatedTimestamp, String timestamp, int buildNumber, boolean fixChecksums, FileMetadata fileMetadata, String groupId, String artifactId, String version, String packaging) throws RepositoryMetadataException
RepositoryMetadataException
Copyright © 2006–2023 The Apache Software Foundation. All rights reserved.