Class GridFsService
java.lang.Object
org.qubership.atp.mia.service.file.GridFsService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanDb()Clean GridFs from old files.voidClean folder with logs.voidcleanMongoProjectFiles(UUID projectId, List<String> excludeIds) Clean mongo ProjectFiles.voiddeleteProjectFile(ProjectFile projectFile) Upload file to GridFs.booleanexistFile(ProjectFile projectFile) Check if file exist.byte[]getByteArrayFromGridFsFile(com.mongodb.client.gridfs.model.GridFSFile file) Returns collections size in selected bucket.Optional<com.mongodb.client.gridfs.model.GridFSFile> voidrename(ProjectFile projectFile) Rename file.voidrestoreFile(File file) Restore file from GridFs.voidSave all file of response in GridFs.org.bson.types.ObjectIduploadFile(FileMetaData fileMetaData, File fullPathToFile) Upload file to GridFs.org.bson.types.ObjectIduploadFile(FileMetaData fileMetaData, String fullPathToFile) Upload file to GridFs.
-
Constructor Details
-
GridFsService
public GridFsService()
-
-
Method Details
-
cleanDb
public void cleanDb()Clean GridFs from old files. -
cleanMongoProjectFiles
Clean mongo ProjectFiles.- Parameters:
projectId- projectIdexcludeIds- excludeIds
-
cleanLogs
Clean folder with logs.- Parameters:
cleanInterval- clean interval
-
deleteProjectFile
Upload file to GridFs.- Parameters:
projectFile- project file
-
existFile
Check if file exist.- Parameters:
projectFile-ProjectFile.
-
getCollectionsSize
Returns collections size in selected bucket.- Returns:
- size in megabytes.
-
rename
Rename file. -
restoreFile
Restore file from GridFs.- Parameters:
file- file.
-
getFile
-
saveLogResponseAfterExecution
Save all file of response in GridFs.- Parameters:
response- execution response.
-
uploadFile
Upload file to GridFs.- Parameters:
fileMetaData- fileMetaData- Returns:
- ObjectId of file in GridFs.
-
uploadFile
Upload file to GridFs.- Parameters:
fileMetaData- fileMetaData- Returns:
- ObjectId of file in GridFs.
-
getByteArrayFromGridFsFile
public byte[] getByteArrayFromGridFsFile(com.mongodb.client.gridfs.model.GridFSFile file)
-