Author image

David Landup

36 Posts Serbia Twitter Website

Executing Shell Commands with Java

Introduction

In this article, we'll take a look at how we can leverage the Runtime and ProcessBuilder classes to execute shell commands and scripts with Java.

We use computers to automate many things in our daily jobs. System administrators run many commands all the time, some of which are very

Continue Reading

Java: Check if a File or Directory Exists

Introduction

Checking if a file or directory exists is a simple and important operation in many tasks. Before accessing a file, we should check if it exists to avoid a NullPointerException. The same goes for directories.

While some functions may create a new file/directory if the requested one doesn't

Continue Reading