Class UploadedFileHelper


  • public class UploadedFileHelper
    extends Object
    A helper object to handle the mundane details of dealing with uploaded files in the model.
    • Constructor Detail

      • UploadedFileHelper

        public UploadedFileHelper​(FileStorage fileStorage,
                                  WebappDaoFactory wadf,
                                  javax.servlet.ServletContext ctx)
    • Method Detail

      • setImagesOnEntity

        public void setImagesOnEntity​(String entityUri,
                                      FileInfo mainInfo,
                                      FileInfo thumbInfo)
        Record this image file and thumbnail on this entity.
      • removeMainImage

        public void removeMainImage​(Individual entity)
        If this Individual has an image, remove it and the thumbnail. If the image file and/or the thumbnail file have no other references, delete them. Note: after this operation, entity is stale.
      • removeUploadedFile

        public void removeUploadedFile​(String subjectUri,
                                       String predicateUri,
                                       String fileUri)
      • attachFileToSubject

        public void attachFileToSubject​(FileInfo fileInfo,
                                        String subjectUri,
                                        String predicateUri)
      • setPublicFileName

        public void setPublicFileName​(FileInfo fileInfo,
                                      String uploadedFileName)