Posts

Showing posts from January, 2020

CreatingImages&METAFileAndPushingToSFTPorFTP

config.properties ---------------------- # Folder location where images exists ReceiptsRootFolder=C:/Users/sivaleti/Pictures/10122019 #ExpenseReportNumber to Which Images in the ReceiptsFolder Will Add as Receipts DocumentNumbers=N001000111112040002 # 1 for SFTP 2 for FTP protocaltype = 2 # SFTP/FTP HostName hostname=10.140.1.122 #sftp01. # SFTP/FTP Host Username username=lowesftpuser #input #SFTP/FTP Host Password password=password #sreehari AddImagesToReports.java --------------------------------- package com.hari.test; import java.util.List; import java.awt.image.BufferedImage; import java.io.File; import java.io.FileNotFoundException; import java.io.InputStream; import java.util.ArrayList; import java.util.Properties; import javax.imageio.ImageIO; import com.ftp.FTPUploaderImpl; import com.sftp.SFTPUploaderImpl; import com.sftp.interf.SFTPUploader; public class AddImagesToReports { public void addImages(String arg) throws Exception { Inp...

Struts 2.35 Change

strict-method-invocation="false"

EncryptionDecryptionNewLogic

import java.security.Key; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import javax.crypto.Cipher; import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.SecretKeySpec; import org.apache.axiom.om.util.Base64;  private static String key = STATIC_AES_128BIT_KEY;  private static String initvector = STATIC_16_BYTE_INITVECTOR;  /**      * Encrypt the value      *      * @param str the value to encrypt      * @return the encrypted value      */     public static String encrypt(String str) { try {     IvParameterSpec iv = new IvParameterSpec(initvector.getBytes("UTF-8"));     Key aesKey = new SecretKeySpec(key.getBytes("UTF-8"), "AES");     Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5PADDING");     cipher.init(Cipher.ENCRYPT_MODE, aesKey, iv);     by...
XML file -------------------- <GDPRTableList> <delete> <table>   <Name>ExpenseReportLineAutoApproved</Name>   <query>select * from ExpenseReportLineAutoApproved where ExpenseReportLineId in (select ExpenseReportLineId from ExpenseReportLine where ExpenseReportId in (Select DocumentId from Document where SubmittedForId=?))</query> </table> <table>   <Name>ExpenseReportLineApprovalChain</Name>   <query>select * from ExpenseReportLineApprovalChain where ExpenseReportLineId in(select ExpenseReportLineId from ExpenseReportLine where ExpenseReportId in (Select DocumentId from Document where SubmittedForId=?))</query> </table> <table>   <Name>ExpenseReportLineWorkflowHist</Name>   <query>select * from ExpenseReportLineWorkflowHist where ExpenseReportLineId in(select ExpenseReportLineId from ExpenseReportLine where ExpenseReportId in (Select DocumentId fr...