public Revokedconsent findByPrimaryKey(RevokedconsentKey arg0)
     throws RemoteException, FinderException {
   while (true) {
     if (!Util.isLocal(this)) {
       InputStream in = null;
       try {
         try {
           org.omg.CORBA_2_3.portable.OutputStream out =
               (org.omg.CORBA_2_3.portable.OutputStream) _request("findByPrimaryKey", true);
           out.write_value(arg0, RevokedconsentKey.class);
           in = (InputStream) _invoke(out);
           return (Revokedconsent) in.read_Object(Revokedconsent.class);
         } catch (ApplicationException ex) {
           in = (InputStream) ex.getInputStream();
           String id = in.read_string();
           if (id.equals("IDL:javax/ejb/FinderEx:1.0")) {
             throw (FinderException) in.read_value(FinderException.class);
           }
           throw new UnexpectedException(id);
         } catch (RemarshalException ex) {
           continue;
         }
       } catch (SystemException ex) {
         throw Util.mapSystemException(ex);
       } finally {
         _releaseReply(in);
       }
     } else {
       ServantObject so =
           _servant_preinvoke(
               "findByPrimaryKey", com.ardais.bigr.iltds.beans.RevokedconsentHome.class);
       if (so == null) {
         continue;
       }
       try {
         RevokedconsentKey arg0Copy = (RevokedconsentKey) Util.copyObject(arg0, _orb());
         Revokedconsent result =
             ((com.ardais.bigr.iltds.beans.RevokedconsentHome) so.servant)
                 .findByPrimaryKey(arg0Copy);
         return (Revokedconsent) Util.copyObject(result, _orb());
       } catch (Throwable ex) {
         Throwable exCopy = (Throwable) Util.copyObject(ex, _orb());
         if (exCopy instanceof FinderException) {
           throw (FinderException) exCopy;
         }
         throw Util.wrapException(exCopy);
       } finally {
         _servant_postinvoke(so);
       }
     }
   }
 }
Esempio n. 2
0
 /** Destroy the remote IDL type object. */
 public void destroy() {
   InputStream in = null;
   try {
     OutputStream out = _request("destroy", true);
     in = _invoke(out);
   } catch (ApplicationException ex) {
     in = ex.getInputStream();
     throw new org.omg.CORBA.MARSHAL(ex.getId());
   } catch (RemarshalException rex) {
     destroy();
   } finally {
     _releaseReply(in);
   }
 }
Esempio n. 3
0
 /**
  * Get the definition kind of the remote IDL type object. The method is written following OMG
  * specification, treating the typecode as a read only attribute rather than a method. This means,
  * the operation name is "_get_def_kind".
  *
  * @return a definition kind, returned by remote IDL type object.
  */
 public DefinitionKind def_kind() {
   InputStream in = null;
   try {
     OutputStream out = _request("_get_def_kind", true);
     in = _invoke(out);
     return DefinitionKindHelper.read(in);
   } catch (ApplicationException ex) {
     in = ex.getInputStream();
     throw new org.omg.CORBA.MARSHAL(ex.getId());
   } catch (RemarshalException rex) {
     return def_kind();
   } finally {
     _releaseReply(in);
   }
 }
 public void remove(Object arg0) throws RemoteException, RemoveException {
   while (true) {
     if (!Util.isLocal(this)) {
       InputStream in = null;
       try {
         try {
           OutputStream out = _request("remove__java_lang_Object", true);
           Util.writeAny(out, arg0);
           _invoke(out);
           return;
         } catch (ApplicationException ex) {
           in = (InputStream) ex.getInputStream();
           String id = in.read_string();
           if (id.equals("IDL:javax/ejb/RemoveEx:1.0")) {
             throw (RemoveException) in.read_value(RemoveException.class);
           }
           throw new UnexpectedException(id);
         } catch (RemarshalException ex) {
           continue;
         }
       } catch (SystemException ex) {
         throw Util.mapSystemException(ex);
       } finally {
         _releaseReply(in);
       }
     } else {
       ServantObject so = _servant_preinvoke("remove__java_lang_Object", javax.ejb.EJBHome.class);
       if (so == null) {
         continue;
       }
       try {
         Object arg0Copy = (Object) Util.copyObject(arg0, _orb());
         ((javax.ejb.EJBHome) so.servant).remove(arg0Copy);
         return;
       } catch (Throwable ex) {
         Throwable exCopy = (Throwable) Util.copyObject(ex, _orb());
         if (exCopy instanceof RemoveException) {
           throw (RemoveException) exCopy;
         }
         throw Util.wrapException(exCopy);
       } finally {
         _servant_postinvoke(so);
       }
     }
   }
 }
Esempio n. 5
0
 public PtsOperation create() throws CreateException, RemoteException {
   while (true) {
     if (!Util.isLocal(this)) {
       InputStream in = null;
       try {
         try {
           OutputStream out = _request("create", true);
           in = (InputStream) _invoke(out);
           return (PtsOperation) in.read_Object(PtsOperation.class);
         } catch (ApplicationException ex) {
           in = (InputStream) ex.getInputStream();
           String id = in.read_string();
           if (id.equals("IDL:javax/ejb/CreateEx:1.0")) {
             throw (CreateException) in.read_value(CreateException.class);
           }
           throw new UnexpectedException(id);
         } catch (RemarshalException ex) {
           continue;
         }
       } catch (SystemException ex) {
         throw Util.mapSystemException(ex);
       } finally {
         _releaseReply(in);
       }
     } else {
       ServantObject so =
           _servant_preinvoke("create", com.ardais.bigr.iltds.beans.PtsOperationHome.class);
       if (so == null) {
         continue;
       }
       try {
         PtsOperation result =
             ((com.ardais.bigr.iltds.beans.PtsOperationHome) so.servant).create();
         return (PtsOperation) Util.copyObject(result, _orb());
       } catch (Throwable ex) {
         Throwable exCopy = (Throwable) Util.copyObject(ex, _orb());
         if (exCopy instanceof CreateException) {
           throw (CreateException) exCopy;
         }
         throw Util.wrapException(exCopy);
       } finally {
         _servant_postinvoke(so);
       }
     }
   }
 }
Esempio n. 6
0
 /**
  * Get the typecode of the remote IDL type object. The method is written following OMG
  * specification, treating the typecode as a read only attribute rather than a method. This means,
  * the operation name is "_get_type".
  *
  * @return a typecode, returned by the remote IDL type object.
  */
 public TypeCode type() {
   InputStream in = null;
   try {
     OutputStream out = _request("_get_type", true);
     in = _invoke(out);
     return TypeCodeHelper.read(in);
   } catch (ApplicationException ex) {
     in = ex.getInputStream();
     throw new org.omg.CORBA.MARSHAL(ex.getId());
   } catch (RemarshalException rex) {
     return type();
   } catch (UserException ex) {
     MARSHAL m = new MARSHAL();
     m.minor = Minor.UserException;
     m.initCause(ex);
     throw m;
   } finally {
     _releaseReply(in);
   }
 }
 public EJBHome getEJBHome() throws RemoteException {
   while (true) {
     if (!Util.isLocal(this)) {
       InputStream in = null;
       try {
         try {
           OutputStream out = _request("_get_EJBHome", true);
           in = _invoke(out);
           return (EJBHome) in.read_Object(EJBHome.class);
         } catch (ApplicationException ex) {
           in = ex.getInputStream();
           String id = in.read_string();
           throw new UnexpectedException(id);
         } catch (RemarshalException ex) {
           continue;
         }
       } catch (SystemException ex) {
         throw Util.mapSystemException(ex);
       } finally {
         _releaseReply(in);
       }
     } else {
       ServantObject so = _servant_preinvoke("_get_EJBHome", javax.ejb.HomeHandle.class);
       if (so == null) {
         continue;
       }
       try {
         EJBHome result = ((javax.ejb.HomeHandle) so.servant).getEJBHome();
         return (EJBHome) Util.copyObject(result, _orb());
       } catch (Throwable ex) {
         Throwable exCopy = (Throwable) Util.copyObject(ex, _orb());
         throw Util.wrapException(exCopy);
       } finally {
         _servant_postinvoke(so);
       }
     }
   }
 }
Esempio n. 8
0
  /**
   * Sends a request message to the server, receives the reply from the server, and returns an
   * <code>Object</code> result to the caller.
   */
  public Object invoke(String operationName, StubStrategy stubStrategy, Object[] params)
      throws Throwable {
    if (operationName.equals("_get_handle") && this instanceof javax.ejb.EJBObject) {
      if (handle == null) {
        handle = new HandleImplIIOP(this);
      }
      return handle;
    } else if (operationName.equals("_get_homeHandle") && this instanceof javax.ejb.EJBHome) {
      if (handle == null) {
        handle = new HomeHandleImplIIOP(this);
      }
      return handle;
    } else if (!_is_local()) {
      // remote call path

      // To check whether this is a local stub or not we must call
      // org.omg.CORBA.portable.ObjectImpl._is_local(), and _not_
      // javax.rmi.CORBA.Util.isLocal(Stub s), which in Sun's JDK
      // always return false.

      InputStream in = null;
      try {
        try {
          OutputStream out = (OutputStream) _request(operationName, true);
          stubStrategy.writeParams(out, params);
          trace("sent request: " + operationName);
          in = (InputStream) _invoke(out);
          if (stubStrategy.isNonVoid()) {
            trace("received reply");
            return stubStrategy.readRetval(in);
            // Object retval = stubStrategy.readRetval(in);
            // trace("retval: " + retval);
            // return retval;
          } else return null;
        } catch (ApplicationException ex) {
          trace("got application exception");
          in = (InputStream) ex.getInputStream();
          throw stubStrategy.readException(ex.getId(), in);
        } catch (RemarshalException ex) {
          trace("got remarshal exception");
          return invoke(operationName, stubStrategy, params);
        }
      } catch (SystemException ex) {
        if (EjbLogger.EJB3_INVOCATION_LOGGER.isTraceEnabled()) {
          EjbLogger.EJB3_INVOCATION_LOGGER.trace("CORBA system exception in IIOP stub", ex);
        }
        throw Util.mapSystemException(ex);
      } finally {
        _releaseReply(in);
      }
    } else {
      // local call path
      org.omg.CORBA.portable.ServantObject so = _servant_preinvoke(operationName, Object.class);
      if (so == null) return invoke(operationName, stubStrategy, params);
      try {
        // params = Util.copyObjects(params, _orb());
        Object retval =
            ((LocalIIOPInvoker) so.servant)
                .invoke(
                    operationName,
                    params,
                    null, /* tx */
                    null, /* identity */
                    null /* credential */);
        return stubStrategy.convertLocalRetval(retval);
        // retval = stubStrategy.convertLocalRetval(retval);
        // return Util.copyObject(retval, _orb());
      } catch (Throwable e) {
        // Throwable ex = (Throwable)Util.copyObject(e, _orb());
        Throwable ex = e;
        if (stubStrategy.isDeclaredException(ex)) throw ex;
        else throw Util.wrapException(ex);
      } finally {
        _servant_postinvoke(so);
      }
    }
  }
  public static ForensicReportBase64 getBase64(String urlHash, String mongoHostIP)
      throws UnknownHostException {
    System.out.println("Create base64 for hash " + urlHash);
    MongoClient mongoclient = new MongoClient(mongoHostIP, 27017);
    Morphia morphia = new Morphia();
    morphia.map(ForensicReport.class).map(dqReport.class);
    Datastore ds = new Morphia().createDatastore(mongoclient, "ForensicDatabase");
    ds.ensureCaps();
    ForensicReportBase64 reportBase64 = new ForensicReportBase64();
    ForensicReport report = ds.get(ForensicReport.class, urlHash);

    if (report != null) {
      if (report.displayImage != null) {
        byte[] displayImageInByte;
        BufferedImage displayImage;
        try {
          displayImage = ImageIO.read(new File(report.displayImage));
          ByteArrayOutputStream displayImagebuffer = new ByteArrayOutputStream();
          ImageIO.write(displayImage, "png", displayImagebuffer);
          displayImagebuffer.flush();
          displayImageInByte = displayImagebuffer.toByteArray();
          displayImagebuffer.close();
          ScalingReport dataScale = new ScalingReport();
          try {
            dataScale = scale(displayImageInByte, 500, 500);
            String displayImageBase64String =
                Base64.getEncoder().encodeToString(dataScale.scaledByte);
            reportBase64.displayImageBase64 = "data:image/jpeg;base64," + displayImageBase64String;
            reportBase64.widthdisplayImage = dataScale.width;
          } catch (ApplicationException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            System.out.println("Scalling exception");
            String displayImageBase64String =
                Base64.getEncoder().encodeToString(displayImageInByte);
            reportBase64.displayImageBase64 = "data:image/jpeg;base64," + displayImageBase64String;
            reportBase64.widthdisplayImage = displayImage.getWidth();
          }
        } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
          System.out.println("Display image exception");
        }
      }
      if (report.thumbnailReport.numberOfThumbnails > 0) {
        for (int ThumbInd = 0; ThumbInd < report.thumbnailReport.thumbnailList.size(); ThumbInd++) {
          try {
            byte[] thumbInByte;
            BufferedImage thumbImage;
            thumbImage = ImageIO.read(new File(report.thumbnailReport.thumbnailList.get(ThumbInd)));
            ByteArrayOutputStream thumbbuffer = new ByteArrayOutputStream();
            ImageIO.write(thumbImage, "png", thumbbuffer);
            thumbbuffer.flush();
            thumbInByte = thumbbuffer.toByteArray();
            thumbbuffer.close();
            ScalingReport thumbScale = new ScalingReport();
            try {
              thumbScale = scale(thumbInByte, 500, 500);
              String thumbBase64String = Base64.getEncoder().encodeToString(thumbScale.scaledByte);
              reportBase64.thumbBase64.add("data:image/jpeg;base64," + thumbBase64String);
              reportBase64.widththumb.add(thumbScale.width);
            } catch (ApplicationException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
              System.out.println("Scalling exception");
              String thumbBase64String = Base64.getEncoder().encodeToString(thumbInByte);
              reportBase64.thumbBase64.add("data:image/jpeg;base64," + thumbBase64String);
              reportBase64.widththumb.add(thumbImage.getWidth());
            }
          } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
          }
        }
      }
      if (report.dqReport.completed) {
        byte[] dqInByte;
        BufferedImage dqImage;
        try {
          dqImage = ImageIO.read(new File(report.dqReport.map));
          ByteArrayOutputStream dqbuffer = new ByteArrayOutputStream();
          ImageIO.write(dqImage, "png", dqbuffer);
          dqbuffer.flush();
          dqInByte = dqbuffer.toByteArray();
          dqbuffer.close();
          ScalingReport dqScale = new ScalingReport();
          try {
            dqScale = scale(dqInByte, 130, 130);
            String dqBase64String = Base64.getEncoder().encodeToString(dqScale.scaledByte);
            reportBase64.dqBase64 = "data:image/jpeg;base64," + dqBase64String;
            reportBase64.widthdq = dqScale.width;
          } catch (ApplicationException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            System.out.println("Scalling exception");
            String dqBase64String = Base64.getEncoder().encodeToString(dqInByte);
            reportBase64.dqBase64 = "data:image/jpeg;base64," + dqBase64String;
            reportBase64.widthdq = dqImage.getWidth();
          }
        } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
      }

      if (report.dwNoiseReport.completed) {
        byte[] dwNoiseInByte;
        BufferedImage dwNoiseImage;
        try {
          dwNoiseImage = ImageIO.read(new File(report.dwNoiseReport.map));
          ByteArrayOutputStream dwNoisebuffer = new ByteArrayOutputStream();
          ImageIO.write(dwNoiseImage, "png", dwNoisebuffer);
          dwNoisebuffer.flush();
          dwNoiseInByte = dwNoisebuffer.toByteArray();
          dwNoisebuffer.close();
          ScalingReport dwNoiseScale = new ScalingReport();
          try {
            dwNoiseScale = scale(dwNoiseInByte, 130, 130);
            String dwNoiseBase64String =
                Base64.getEncoder().encodeToString(dwNoiseScale.scaledByte);
            reportBase64.dwNoiseBase64 = "data:image/jpeg;base64," + dwNoiseBase64String;
            reportBase64.widthdwNoise = dwNoiseScale.width;
          } catch (ApplicationException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            System.out.println("Scalling exception");
            String dwNoiseBase64String = Base64.getEncoder().encodeToString(dwNoiseInByte);
            reportBase64.dwNoiseBase64 = "data:image/jpeg;base64," + dwNoiseBase64String;
            reportBase64.widthdwNoise = dwNoiseImage.getWidth();
          }
        } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
      }
      if (report.elaReport.completed) {
        byte[] elaInByte;
        BufferedImage elaImage;
        try {
          elaImage = ImageIO.read(new File(report.elaReport.map));
          ByteArrayOutputStream elabuffer = new ByteArrayOutputStream();
          ImageIO.write(elaImage, "png", elabuffer);
          elabuffer.flush();
          elaInByte = elabuffer.toByteArray();
          elabuffer.close();
          ScalingReport elaScale = new ScalingReport();
          try {
            elaScale = scale(elaInByte, 130, 130);
            String elaBase64String = Base64.getEncoder().encodeToString(elaScale.scaledByte);
            reportBase64.elaBase64 = "data:image/jpeg;base64," + elaBase64String;
            reportBase64.widthela = elaScale.width;
          } catch (ApplicationException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            System.out.println("Scalling exception");
            String elaBase64String = Base64.getEncoder().encodeToString(elaInByte);
            reportBase64.elaBase64 = "data:image/jpeg;base64," + elaBase64String;
            reportBase64.widthela = elaImage.getWidth();
          }
        } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
      }
      if (report.blockingReport.completed) {
        byte[] blockingInByte;
        BufferedImage blockingImage;
        try {
          blockingImage = ImageIO.read(new File(report.blockingReport.map));
          ByteArrayOutputStream blockingbuffer = new ByteArrayOutputStream();
          ImageIO.write(blockingImage, "png", blockingbuffer);
          blockingbuffer.flush();
          blockingInByte = blockingbuffer.toByteArray();
          blockingbuffer.close();
          ScalingReport blockingScale = new ScalingReport();
          try {
            blockingScale = scale(blockingInByte, 130, 130);
            String blockingBase64String =
                Base64.getEncoder().encodeToString(blockingScale.scaledByte);
            reportBase64.blockingBase64 = "data:image/jpeg;base64," + blockingBase64String;
            reportBase64.widthblocking = blockingScale.width;
          } catch (ApplicationException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            System.out.println("Scalling exception");
            String blockingBase64String = Base64.getEncoder().encodeToString(blockingInByte);
            reportBase64.blockingBase64 = "data:image/jpeg;base64," + blockingBase64String;
            reportBase64.widthblocking = blockingImage.getWidth();
          }
        } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
      }
      if (report.medianNoiseReport.completed) {
        byte[] medianNoiseInByte;
        BufferedImage medianNoiseImage;
        try {
          medianNoiseImage = ImageIO.read(new File(report.medianNoiseReport.map));
          ByteArrayOutputStream medianNoisebuffer = new ByteArrayOutputStream();
          ImageIO.write(medianNoiseImage, "png", medianNoisebuffer);
          medianNoisebuffer.flush();
          medianNoiseInByte = medianNoisebuffer.toByteArray();
          medianNoisebuffer.close();
          ScalingReport medianNoiseScale = new ScalingReport();
          try {
            medianNoiseScale = scale(medianNoiseInByte, 130, 130);
            String medianNoiseBase64String =
                Base64.getEncoder().encodeToString(medianNoiseScale.scaledByte);
            reportBase64.medianNoiseBase64 = "data:image/jpeg;base64," + medianNoiseBase64String;
            reportBase64.widthmedianNoise = medianNoiseScale.width;
          } catch (ApplicationException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            System.out.println("Scalling exception");
            String medianNoiseBase64String = Base64.getEncoder().encodeToString(medianNoiseInByte);
            reportBase64.medianNoiseBase64 = "data:image/jpeg;base64," + medianNoiseBase64String;
            reportBase64.widthmedianNoise = medianNoiseImage.getWidth();
          }
        } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
      }
      if (report.ghostReport.completed) {

        try {
          for (int GhostInd = 0; GhostInd < report.ghostReport.maps.size(); GhostInd++) {
            byte[] ghostInByte;
            BufferedImage ghostImage;
            ghostImage = ImageIO.read(new File(report.ghostReport.maps.get(GhostInd)));
            ByteArrayOutputStream ghostbuffer = new ByteArrayOutputStream();
            ImageIO.write(ghostImage, "png", ghostbuffer);
            ghostbuffer.flush();
            ghostInByte = ghostbuffer.toByteArray();
            ghostbuffer.close();
            ScalingReport ghostScale = new ScalingReport();
            try {
              ghostScale = scale(ghostInByte, 130, 130);
              String ghostBase64String = Base64.getEncoder().encodeToString(ghostScale.scaledByte);
              reportBase64.ghostBase64.add("data:image/jpeg;base64," + ghostBase64String);
              reportBase64.widthghost.add(ghostScale.width);
            } catch (ApplicationException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
              System.out.println("Scalling exception");
              String ghostBase64String = Base64.getEncoder().encodeToString(ghostInByte);
              reportBase64.ghostBase64.add("data:image/jpeg;base64," + ghostBase64String);
              reportBase64.widthghost.add(ghostImage.getWidth());
            }
          }
        } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
      }

      if (report.gridsReport.completed) {
        byte[] gridsInByte, gridsInvInByte;
        BufferedImage gridsImage, gridsInvImage;
        String gridsBase64String, gridsInvBase64String;
        try {
          // GRIDS
          gridsImage = ImageIO.read(new File(report.gridsReport.map));
          ByteArrayOutputStream gridsbuffer = new ByteArrayOutputStream();
          ImageIO.write(gridsImage, "png", gridsbuffer);
          gridsbuffer.flush();
          gridsInByte = gridsbuffer.toByteArray();
          gridsbuffer.close();
          ScalingReport gridsScale = new ScalingReport();
          try {
            gridsScale = scale(gridsInByte, 130, 130);
            gridsBase64String = Base64.getEncoder().encodeToString(gridsScale.scaledByte);
            reportBase64.gridsBase64 = "data:image/jpeg;base64," + gridsBase64String;
            reportBase64.widthgrids = gridsScale.width;
          } catch (ApplicationException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            System.out.println("Scalling exception");
            gridsBase64String = Base64.getEncoder().encodeToString(gridsInByte);
            reportBase64.gridsBase64 = "data:image/jpeg;base64," + gridsBase64String;
            reportBase64.widthgrids = gridsImage.getWidth();
          }

          // GRIDS INVERSED
          gridsInvImage = ImageIO.read(new File(report.gridsInversedReport.map));
          ByteArrayOutputStream gridsInvbuffer = new ByteArrayOutputStream();
          ImageIO.write(gridsInvImage, "png", gridsInvbuffer);
          gridsInvbuffer.flush();
          gridsInvInByte = gridsInvbuffer.toByteArray();
          gridsInvbuffer.close();
          ScalingReport gridsInvScale = new ScalingReport();
          try {
            gridsInvScale = scale(gridsInvInByte, 130, 130);
            gridsInvBase64String = Base64.getEncoder().encodeToString(gridsInvScale.scaledByte);
            reportBase64.gridsInversedBase64 = "data:image/jpeg;base64," + gridsInvBase64String;
            reportBase64.widthgridsInversed = gridsInvScale.width;
          } catch (ApplicationException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            System.out.println("Scalling exception");
            gridsInvBase64String = Base64.getEncoder().encodeToString(gridsInvInByte);
            reportBase64.gridsInversedBase64 = "data:image/jpeg;base64," + gridsInvBase64String;
            reportBase64.widthgridsInversed = gridsInvImage.getWidth();
          }
        } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
      }

    } else {
      System.out.println("report is empty");
    }
    mongoclient.close();
    return reportBase64;
  }