Class FileService
- java.lang.Object
-
- cz.zcu.students.cacha.bp_server.services.FileService
-
@Service public class FileService extends Object
Class represent service which is responsible for images operations
-
-
Constructor Summary
Constructors Constructor Description FileService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deleteExhibitImage(String image)
Delete exhibit imagevoid
deleteInfoLabelImage(String image)
Delete info label imagevoid
deleteInstitutionImage(String image)
Deletes institution imageString
detectType(byte[] fileArr)
Detects the type of fileString
saveExhibitImage(String encodedImage)
Saves given exhibit image and returns its nameString
saveInfoLabelImage(String encodedInfoLabel)
Saves given info label image and returns its nameString
saveInstitutionImage(String encodedImage)
Saves given institution image and returns its name
-
-
-
Field Detail
-
separator
public static final String separator
Separator that can occur at the beginning of base64 string- See Also:
- Constant Field Values
-
-
Method Detail
-
detectType
public String detectType(byte[] fileArr)
Detects the type of file- Parameters:
fileArr
- bytes of file- Returns:
- detected type
-
saveInstitutionImage
public String saveInstitutionImage(String encodedImage) throws Exception
Saves given institution image and returns its name- Parameters:
encodedImage
- base64 encoded image- Returns:
- saved image name
- Throws:
Exception
-
deleteInstitutionImage
public void deleteInstitutionImage(String image)
Deletes institution image- Parameters:
image
- name
-
saveExhibitImage
public String saveExhibitImage(String encodedImage) throws Exception
Saves given exhibit image and returns its name- Parameters:
encodedImage
- base64 encoded image- Returns:
- saved image name
- Throws:
Exception
-
deleteExhibitImage
public void deleteExhibitImage(String image)
Delete exhibit image- Parameters:
image
- name
-
saveInfoLabelImage
public String saveInfoLabelImage(String encodedInfoLabel) throws Exception
Saves given info label image and returns its name- Parameters:
encodedInfoLabel
- base64 encoded image- Returns:
- saved image name
- Throws:
Exception
-
deleteInfoLabelImage
public void deleteInfoLabelImage(String image)
Delete info label image- Parameters:
image
- name
-
-