-
Recent Posts
- Follow softwarecave on WordPress.com
Archives
- December 2021 (1)
- October 2021 (2)
- April 2018 (1)
- March 2018 (3)
- February 2018 (1)
- February 2017 (4)
- December 2014 (3)
- November 2014 (2)
- August 2014 (1)
- July 2014 (2)
- June 2014 (2)
- May 2014 (2)
- April 2014 (5)
- March 2014 (9)
- February 2014 (11)
- January 2014 (6)
- September 2011 (1)
Categories
Tag Archives: NIO
Delete directory with contents in Java
Removing empty directory in Java is as simple as calling File.delete() (standard IO) or Files.delete() (NIO) method. However, if the folder is not empty (for example contains one or more files or subdirectories), these methods will refuse to remove it. … Continue reading
How to delete file in Java
File management (good old CRUD: create, read, update, delete) is quite common operation in software development. In this short post I would like to present 2 ways of removing files in Java. Method available in every Java version Every Java … Continue reading
Reading text file line by line in Java
Reading text files from hard disk is quite common task in software development practice. Usually we are interested in processing it line by line. In this article I would like to present few popular ways how to do it easily … Continue reading
Recursively walking directory using Java NIO
Sometimes you may need to recursively visit all files and subdirectories of given directory and perform some actions on it. The typical use case is searching files of a given type, copying or removing a directory including all its contents. … Continue reading
Create temporary files and directories using Java NIO2
Temporary files and directories are very useful in many situations. One typical case is that you are writing some (usually large) file and you don’t want anybody to accidentally access and mess with it until is completely written and closed. … Continue reading