What do you want to save?
Add Code snippet
New code examples
-
Java 2021-10-25 07:58:10
java read csv file into arraylist
import java.io.BufferedReader; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; /** * Simple Java ... Add solution -
Java 2021-10-25 00:50:11
java code to get all leaf nodes of a xml
try { final Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse("input.xml"); final XPathExpression xpath = XPathFactory.newInstance().newXPath().compile("//*[count(./*) = 0]"); final NodeList nodeList ... Add solution -
Other 2021-10-24 00:23:07
where do you implement static block in framework
Static Block: I use static block in DBUtilities class. See below... static { try { connection = DriverManager.getConnection(url, username, password); statement = connection.createStatement(); metadata = connection.g... Add solution -
Java 2021-10-23 05:29:13
Java create zip file
import java.io.FileOutputStream; import java.io.IOException; import java.nio.file.*; import java.nio.file.attribute.BasicFileAttributes; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; public class ZipCompress { public static voi... Add solution -
Javascript 2021-10-22 07:14:07
how to use aes for encryption and decryption in json object in java with demo
import java.io.UnsupportedEncodingException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.Arrays; import java.util.Base64; import javax.crypto.Cipher; import javax.crypto.spec.SecretKeySpec; &n... Add solution -
Java 2021-10-20 21:49:06
Read File from Sprinboot
Using ResourceUtil @Override public void run(String... args) throws Exception { File file = ResourceUtils.getFile("classpath:data.txt"); if(file.exists()) { byte[] fileData = Files.readAllBytes(file.toPath()); String fileContent = ne... Add solution -
Java 2021-10-19 21:00:03
how to generate and save image of layout in android
LinearLayout content = findViewById(R.id.rlid); content.setDrawingCacheEnabled(true); Bitmap bitmap = content.getDrawingCache(); File file,f; if (android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUN... Add solution -
Java 2021-10-19 10:08:11
swing java read excel sheet
import java.io.*; import java.awt.*; import java.util.*; import javax.swing.*; import java.awt.event.*; import javax.swing.table.*; import jxl.Cell; import jxl.Sheet; import jxl.Workbook; public class ExcelToJtable { public static void main(String[] a... Add solution