Monthly Archives: December 2017

Check the Operating System – Java Utility

public class SystemUtility { private static String OS = System.getProperty(“os.name”).toLowerCase(); /** * If System is Windows OS * @return */ public static boolean isWindows() { return (OS.indexOf(“win”) >= 0); } /** * If System OS is Mac * @return */ … Continue reading

Rate this:

| Leave a comment

Compare two table columns attributes data – Using SQL Queries

/** * Create Source table for Compare CSV Files Data * @param filePath * @param conn * @param chunkId * @param subsetId * @throws Exception */ public void getFileContentSRC(String filePath,Connection conn,String chunkId,String subsetId) throws Exception { String sql=””; CSVParser parser … Continue reading

Rate this:

| Leave a comment

Get the common files names in 2 different directories – Java Utility

/** * This will return common file names from the List * @param localListOfFiles * @param sdpListOfFiles * @return */ public static List getCommonFileNames(File[] localListOfFiles,File[] sdpListOfFiles) { List<String> commonFiles=new ArrayList<String>(); for (int j = 0; j < localListOfFiles.length; j++) { … Continue reading

Rate this:

| Leave a comment

Get the Latest Files from the Particular Directory – Java Utility

/** * This can get the Latest file from the Directory * @param dirPath * @return */ public String getLatestFilefromDir(String dirPath){ File dir = new File(dirPath); File[] files = dir.listFiles(); if (files == null || files.length == 0) { return … Continue reading

Rate this:

| Leave a comment

File Transfer Check – MD5 Checksum Java Utility

import java.io.FileInputStream; import java.security.MessageDigest; public class MD5CheckSumUtility { /** * This will check the MD5 Checking * @param fileInput * @return * @throws Exception */ public String checkMD5(String fileInput)throws Exception { MessageDigest md = MessageDigest.getInstance(“MD5”); FileInputStream fis = new FileInputStream(fileInput); … Continue reading

Rate this:

| Leave a comment

Compare Column/Attribute Data – Using Java Set Operations

/** * This will return all Elements in Both the CSV files * @param coll1 * @param coll2 * @return */ public static Collection union(Collection coll1, Collection coll2) { Set union = new TreeSet(coll1); union.addAll(new TreeSet(coll2)); return union; } /** … Continue reading

Rate this:

| Leave a comment