Class MiaFileService

java.lang.Object
org.qubership.atp.mia.service.file.MiaFileService

@Service public class MiaFileService extends Object
  • 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 - projectFileType
      sessionId - sessionId
      fileName - fineName
      servletContext - servletContext
      Returns:
      ResponseEntity
    • getFile

      public File getFile(File file)
      Get file.
      Parameters:
      file - File
      Returns:
      File
    • getFile

      public File getFile(String file)
      Get file.
      Parameters:
      file - file
      Returns:
      File
    • removeProjectFile

      public void removeProjectFile(ProjectFile projectFile)
      Remove project file.
      Parameters:
      projectFile - projectFile
    • renameProjectFile

      public void renameProjectFile(ProjectFile projectFile, String newFileName)
      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

      public org.bson.types.ObjectId saveLogFile(FileMetaData fileMetaData, File logFile)
      Save log file.
      Parameters:
      fileMetaData - fileMetaData
      logFile - logFile
      Returns:
      ObjectId of file in GridFs
    • uploadConfigurationFileOnBe

      public String uploadConfigurationFileOnBe(org.springframework.web.multipart.MultipartFile file)
      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 - file
      needDos2Unix - boolean
      Returns:
      File