Package org.lightadmin.core.web.support

Examples of org.lightadmin.core.web.support.FilePropertyValue


    private FilePropertyValue evaluateFilePropertyValue(Object instance, PersistentProperty persistentProperty) {
        FileResourceStorage fileResourceStorage = fileResourceStorage();

        try {
            if (!fileResourceStorage.fileExists(instance, persistentProperty)) {
                return new FilePropertyValue(false);
            }

            Link fileLink = entityLinks().linkForFilePropertyLink(instance, persistentProperty);

            byte[] fileData = fileResourceStorage.load(instance, persistentProperty);

            return new FilePropertyValue(fileLink, fileData);

        } catch (Exception e) {
            throw new ResourceNotFoundException(e.getMessage());
        }
    }
View Full Code Here


    }

    private Resource<FilePropertyValue> fileResource(Map.Entry<String, MultipartFile> fileEntry) throws IOException {
        MultipartFile multipartFile = fileEntry.getValue();

        FilePropertyValue filePropertyValue = new FilePropertyValue(multipartFile.getOriginalFilename(), multipartFile.getBytes());

        return new Resource<FilePropertyValue>(filePropertyValue);
    }
View Full Code Here

TOP

Related Classes of org.lightadmin.core.web.support.FilePropertyValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.