Class MiaFileService
java.lang.Object
org.qubership.atp.mia.service.file.MiaFileService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<org.springframework.core.io.Resource> downloadFile(UUID projectId, ProjectFileType projectFileType, UUID sessionId, String fileName, javax.servlet.ServletContext servletContext) Download file.Get file.Get file.voidremoveProjectFile(ProjectFile projectFile) Remove project file.voidrenameProjectFile(ProjectFile projectFile, String newFileName) Remove project file.org.bson.types.ObjectIdsaveLogFile(FileMetaData fileMetaData, File logFile) Save log file.org.bson.types.ObjectIdsaveProjectFile(org.springframework.web.multipart.MultipartFile file, Path filePath) Save project file.uploadConfigurationFileOnBe(org.springframework.web.multipart.MultipartFile file) Upload file provided by FE to BE.uploadFileOnBe(org.springframework.web.multipart.MultipartFile file, boolean needDos2Unix) Upload file provided by FE to BE along with Dos2Unix conversion when needDos2Unix is true and Os is Linux.
-
Constructor Details
-
MiaFileService
public MiaFileService()
-
-
Method Details
-
downloadFile
public org.springframework.http.ResponseEntity<org.springframework.core.io.Resource> downloadFile(UUID projectId, ProjectFileType projectFileType, UUID sessionId, String fileName, javax.servlet.ServletContext servletContext) Download file. Firstly attempts to download it locally, if it's not present then secondly it attempts to download from Mongo DB (if activated).- Parameters:
projectFileType- projectFileTypesessionId- sessionIdfileName- fineNameservletContext- servletContext- Returns:
ResponseEntity
-
getFile
Get file. -
getFile
Get file.- Parameters:
file- file- Returns:
File
-
removeProjectFile
Remove project file.- Parameters:
projectFile- projectFile
-
renameProjectFile
Remove project file.- Parameters:
projectFile- projectFile
-
saveProjectFile
public org.bson.types.ObjectId saveProjectFile(org.springframework.web.multipart.MultipartFile file, Path filePath) Save project file.- Parameters:
file- file- Returns:
File
-
saveLogFile
Save log file.- Parameters:
fileMetaData- fileMetaDatalogFile- logFile- Returns:
ObjectIdof file in GridFs
-
uploadConfigurationFileOnBe
Upload file provided by FE to BE.- Parameters:
file- file- Returns:
- file path
-
uploadFileOnBe
public String uploadFileOnBe(org.springframework.web.multipart.MultipartFile file, boolean needDos2Unix) Upload file provided by FE to BE along with Dos2Unix conversion when needDos2Unix is true and Os is Linux.- Parameters:
file- fileneedDos2Unix- boolean- Returns:
File
-