Posts

Showing posts from 2019

Beginner Level BodyBuilding Work From Arnold_Schwarzenegger_The_New_Encyclopedia

Image

Encryption And Decryption Using AES 128

import java.util.Base64; import java.util.Scanner; import javax.crypto.Cipher; import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.SecretKeySpec; /**  *  * Program to Encrypt/Decrypt String Using AES 128 bit Encryption Algorithm   */ public class EncryptDecryptString { private static final String encryptionKey = "SUMTOTALEXPENSE!"; private static final String characterEncoding = "UTF-8"; private static final String cipherTransformation = "AES/CBC/PKCS5PADDING"; private static final String aesEncryptionAlgorithem = "AES"; /** *      * Method for Encrypt Plain String Data      * @param plainText *      * @return encryptedText      */ public static String encrypt(String plainText) { String encryptedText = ""; try { Cipher cipher = Cipher.getInstance(cipherTransformation); byte[] key = encryptionKey.getBytes(characterEncoding); SecretKeySpec secre...

Downloading Images Through PDFBox

RetrieveAndDownloadImages.java package com.hari.main.imageretrieve; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.FileOutputStream; import java.io.InputStream; import java.util.ArrayList; import java.util.Date; import java.util.List; import org.apache.axiom.om.util.Base64; import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.pdfbox.pdmodel.PDDocumentCatalog; import org.apache.pdfbox.pdmodel.PDPage; import org.apache.pdfbox.pdmodel.common.PDRectangle; import com.kwiktag.webservices.util.XmlUtil; import com.kwiktag.webservices.util.kwiktagUtils; import com.necho.platform.service.receiptretriever.ReceiptRetriever; import com.necho.platform.service.receiptupload.PDFDocumentHelper; import com.necho.platform.service.receiptupload.TIFFBilevelVerifierImpl; import com.necho.platform.service.receiptupload.TIFFInfoVO; import com.necho.platform.service.receiptupload.TIFFVerifier; public class RetrieveAndDownloadImages...

Reading And Writing Image Files using Java

GenerateOutputFileName.java --------------------------------------- import java.io.File; import java.io.IOException; import java.util.Date; import javax.imageio.ImageIO; import java.awt.image.BufferedImage; public class GenerateOutputFileName { public static void main(String[] args) throws Exception{ File outputDirFile = new File("C:\\Users\\sivaleti\\Desktop\\Tmp"); String directoryName ="C:\\Users\\sivaleti\\Downloads\\Images\\"; String generatedFileDir ="C:\\Users\\sivaleti\\Desktop\\FTP1\\"; File folder = new File(directoryName); File[] listOfFiles = folder.listFiles(); System.out.println("Start :" + new Date()); for (int i = 0; i < listOfFiles.length; i++) { try { String fileExtension = getFileExtension(listOfFiles[i]); if(fileExtension.length() > 3 || fileExtension.equalsIgnoreCase("svg")) continue; String documentNumber = "N00100011111" + (2190137+i+1);...

Remote Debugging with Eclipse + WebSphere 8

Image
So far, there is still lack of WebSphere 7 plugin for both Eclipse and NetBeans IDE. However, you are able to debug your web application via  Java Debugger (jdb) . Here’s a guide to show you how to remote debugging your web application in Eclipse and WebSphere via Java Debugger (jdb). Eclipse < ---- > Java Debugger ( jdb ) < ---- > WebSphere 7 Copy 1. Enable WebSphere in Debug Mode In WebSphere web console, left navigation, 1. Servers –> Server Types –> WebSphere application servers 2. Under Server Infrastructure section –> expand Java and Process Management –> Process definition 3. Under Additional Properties section –> click Java Virtual Machine 4. Checked the “ Debug Mode ” 5. In Debug arguments textbox, put this - Xdebug - Xnoagent - Xrunjdwp : transport = dt_socket , server = y , suspend = n , address = 8888 Copy 6. Restart WebSphere server instance. Now, WebSphere is started in debug mode, and listening on port ...

Enabling WL-Proxy-SSL HTTP header in WebLogic

Scenario : Weblogic server will be always behind the LoadBalancer or Apache layer. Most of the time the SSL's will be either offloaded in LoadBalancer or Apache layer.  To construct applicaitons URL's with the right protocol will be a challenge while using weblogic as application server.  To achieve this scenario we have to enable  WL-Proxy-SSL  and  WebLogic Plug-In Enabled. Solution: - Update the LoadBalancer configurations/iRules to set the RequestHeader  WL-Proxy-SSL  to  true . - Follow the below steps to set the WebLogic 'Plugin Enabled' flag to Yes. (Following steps are based on the weblogic version 12.1.2)    - Login into weblogic console    - Click on Lock & Edit button     - Click on the domain name    - Under Configurations tab go to "Web Applications" sub tab    - Select the check box "WebLogic Plugin Enabled" and click "save" button    - Finally click on "...