Package org.apache.olio.webapp.util.fs

Examples of org.apache.olio.webapp.util.fs.FileSystem.open()


        // serve up image from proper location
        // Use local file system if the image is in default location.
        logger.finer("AcessArtifact -- imagePath = " + imagePath);
        InputStream is = null;
        try {
            is = fs.open(imagePath);
        } catch (FileNotFoundException nfe) {
            logger.severe("File not found - imagePath = " + imagePath);
        } catch (IOException ioe) {
            logger.severe("IOException - imagePath = " + imagePath);
        }
View Full Code Here


                    System.out.println("Not a FileInputStream");
                }
                InputStream iStream = null;
                try {
                    OutputStream oStream = response.getOutputStream();
                    iStream = fs.open(imageFile.getCanonicalPath());
                    // With the current implementation, we only support FS, so this is a plcae holder.
                    // TODO - Optimize this (if required) when DFS is supported
                    byte[] buffer = new byte[4096];
                    int len;
                    while ((len = iStream.read(buffer)) != -1) {
View Full Code Here

    /** Creates a new instance of ImageScaler */
    public ImageScaler(String imagePath) throws IOException {
        // Addded for DFS support
        // if we use Hadoop or Mogile, we need to get the image from the remote store
        FileSystem fs = ServiceLocator.getInstance().getFileSystem();
        InputStream iStream = fs.open(imagePath);
        this.image = ImageIO.read(iStream);
        try {
            iStream.close();
        }
        catch (Exception e) {}
View Full Code Here

        this.thumbHeight = height;
       
        // Added for for DFS support
        // if we use Hadoop or Mogile, we need to get the image from the remote store
        FileSystem fs = ServiceLocator.getInstance().getFileSystem();
        InputStream iStream = fs.open(imagePath);
        this.image = ImageIO.read(iStream);
        try {
            iStream.close();
        }
        catch (Exception e) {}
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.