Examples of ImageFile


Examples of org.dddlib.image.api.pojo.ImageFile

    public ImageFile getImageFile(String imageID) {
        assert cache!=null : "cache不能为空";
        assert imageID!=null :"请指定图片ID";

        if (cache.containsKey(imageID)) {
            ImageFile imageFile = (ImageFile) cache.get(imageID);
            return imageFile;
        }
        return null;
    }
View Full Code Here

Examples of org.dddlib.image.api.pojo.ImageFile

        File file = new File(directory + File.separator + imageId);
        try {
            if (file.exists()) {
                byte[] contents = FileUtils.readFileToByteArray(file);
                String fileName = imageId.substring(imageId.indexOf(FILE_SUFFIX) + FILE_SUFFIX.length());
                ImageFile imageFile = new ImageFile(contents, fileName);
                return imageFile;
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
View Full Code Here

Examples of org.dddlib.image.api.pojo.ImageFile

        String mediaId =  imageAccess.saveImageFile(FileUtils.readFileToByteArray(new File(file)),"abc.jpg");

        assertTrue(mediaId!=null);

        ImageFile imageFile = imageAccess.getImageFile(mediaId);

        assertTrue(imageFile.getContent()!=null);
        assertTrue(imageFile.getFileName().equals("abc.jpg"));

    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.