
Posted In: IO, Java Core
How to create a temporary file/directory in Java
JDK 7 createTempDirectory and createTempFile method creates temp folder with given suffix. I have also added deleteOnExit to delete temp folder but dir.toFile().deleteOnExit() does not seem to be reliable on Windows. package com.example.java.core; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import org.junit.Test; public class TempFile { @Test public void create() throws Exception { Path dir = […]
Read More
Posted In: IO, Java Core
How to create a file and write text to it
Techniques used 1. Before JDK 7 using BufferedWriter 2. Using JDK 7 Files 3. Apache Commons IOUtils 4. Guava library
Read More
Posted In: IO, Java Core
How to create a Java List from the contents of a file
Techniques used 1. Before JDK 7 using BufferedReader 2. Using JDK 7 Files 3. Apache Commons IOUtils 4. Guava library
Read More
Posted In: IO, Java Core
How to create a Java string from the contents of a file
Techniques used 1. Before JDK 7 using BufferedReader 2. Using JDK 7 Files 3. Apache Commons IOUtils 4. Guava library
Read More- Apache (13)
- Build Tools (2)
- Gradle (2)
- Caching (1)
- cpanel (1)
- cURL (1)
- Database (7)
- Hibernate (5)
- Java Core (38)
- Java Script (15)
- Bootstrap (1)
- File Upload (7)
- jQuery (3)
- React (3)
- JEE (13)
- JSON (41)
- GSON (13)
- Jackson 1X (1)
- Jackson 2X (12)
- jsoniter (1)
- Logging (2)
- Apache Commons Logging (1)
- Apache Log4J (1)
- Logback (1)
- SLF4J (1)
- MongoDB (1)
- OS (1)
- Linux (1)
- Security (5)
- Server (4)
- Tomcat (4)
- Service (2)
- Micro (2)
- Spring (46)
- Pattern (2)
- Spring Boot (20)
- Spring Data (4)
- Spring MVC (8)
- Spring REST (13)
- Spring Security (7)
- Testing (11)
- XML (5)
- JDOM XML Parser (1)