Package it.eng.spagobi.utilities.service

Examples of it.eng.spagobi.utilities.service.IStreamEncoder


         throw new DrawMapServiceException(getActionName(), "Impossible to render map", t);
      }
     
      responseFileName = "map.svg";
     
      IStreamEncoder encoder = null;
      File tmpFile = null;
      if(outputFormat.equalsIgnoreCase(GeoEngineConstants.JPEG)) {
        encoder = new SVGMapConverter();
        responseFileName =  "map.jpeg";
      }else if(outputFormat.equalsIgnoreCase(GeoEngineConstants.PDF)){
       
        encoder = new SVGMapConverter();
        BufferedInputStream bis = null;
       
        String dirS = System.getProperty("java.io.tmpdir");
        File imageFile = null;
        bis = new BufferedInputStream( new FileInputStream(maptmpfile) );
        try {
          int contentLength = 0;
          int b = -1;
          String contentFileName = "tempJPEGExport";
          freezeHttpResponse();
                   
          File dir = new File(dirS);
          imageFile = File.createTempFile("tempJPEGExport", ".jpeg" , dir);
          FileOutputStream stream = new FileOutputStream(imageFile);
         
          encoder.encode(bis,stream);
         
          stream.flush();
          stream.close();   
         
          File dirF = new File(dirS);
View Full Code Here


         throw new DrawMapServiceException(getActionName(), "Impossible to render map", t);
      }
     
      responseFileName = "map.svg";
     
      IStreamEncoder encoder = null;
      File tmpFile = null;
      if(outputFormat.equalsIgnoreCase(GeoEngineConstants.JPEG)) {
        encoder = new SVGMapConverter();
        responseFileName =  "map.jpeg";
      }else if(outputFormat.equalsIgnoreCase(GeoEngineConstants.PDF)){
       
        encoder = new SVGMapConverter();
        BufferedInputStream bis = null;
       
        String dirS = System.getProperty("java.io.tmpdir");
        File imageFile = null;
        bis = new BufferedInputStream( new FileInputStream(maptmpfile) );
        try {
          int contentLength = 0;
          int b = -1;
          String contentFileName = "tempJPEGExport";
          freezeHttpResponse();
                   
          File dir = new File(dirS);
          imageFile = File.createTempFile("tempJPEGExport", ".jpeg" , dir);
          FileOutputStream stream = new FileOutputStream(imageFile);
         
          encoder.encode(bis,stream);
         
          stream.flush();
          stream.close();   
         
          File dirF = new File(dirS);
View Full Code Here

TOP

Related Classes of it.eng.spagobi.utilities.service.IStreamEncoder

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.