SupportWriter space ↗
A JOURNAL ABOUT TECHNOLOGY

Learn something new.
Write. Share.

A space to connect knowledge, one line of code a day.
Discover tutorials, ideas, and notes from a learning journey.

1967 notes & counting ↙
EDITOR’S PICK ↗
Pentesting

Planning Your First Web Application Pentest: Scope, Safety, and Evidence

Build a focused web pentest plan with clear authorization, realistic objectives, controlled testing, and evidence that developers can use.

D Putu Adi Guna Permana · 3 min read
FOR YOUR CURIOSITY

Latest notes.

CORE API / NOTES</>↗
Core API14 Jul 2006

How do I determine if a pathname is a directory?

To determine if an abstract pathname is a directory we can use the File.isDirectory() method. Here is an example code. package org.kodejava.io; import java.io.File; public class IsDirectoryExample { public static void main(String[] args) { // Creates a instance of File. File file = new File("C:/Users/wsaryada"); // Check if the abstract pathname is a directory by […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API13 Jul 2006

How do I get total space and free space of my disk?

package org.kodejava.io; import java.io.File; public class FreeSpaceExample { public static void main(String[] args) { // We create an instance of a File to represent a partition // of our file system. For instance here we used a drive D: // as in Windows operating system. File file = new File("D:"); // Using the getTotalSpace() we […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API08 Jul 2006

How do I rename a file or directory?

package org.kodejava.io; import java.io.File; import java.io.IOException; public class FileRenameExample { public static void main(String[] args) throws IOException { // Creates a new file called OldHouses.csv File oldFile = new File("OldHouses.csv"); boolean created = oldFile.createNewFile(); System.out.println("File created? " + created); // Creates the target file. File newFile = new File("NewHouses.csv"); // The renameTo() method renames file […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API05 Jul 2006

How do I check if a file is hidden?

The File.isHidded() method checks to see if the file represented by aFile object is a hidden file. The definition of hidden is varied between operating systems. On UNIX based systems, a file is considered to be hidden when their name begins with a period character ('.'). On Windows operating system, a file is considered to […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API02 Jul 2006

How do I get the content of a directory?

In this example you’ll see how to read the list of files inside a directory. To get this functionality we can use the File.listFiles() method. This method return an array of File object which can be either an instance of file or directory. package org.kodejava.io; import java.io.File; import java.io.FilenameFilter; public class DirectoryContentExample { public static […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API27 Jun 2006

How do I create a new directory in Java?

We create a directory by calling mkdir() method of the File object. This method returns true if and only if the directory was successfully created. If false was returned, no directory is created. This could be caused, for example that the directory was already exists. package org.kodejava.io; import java.io.File; public class CreateDirectoryExample { public static […]

Wayan · 1 min read
✳

Knowledge grows when shared.

Stay curious. There is always something new to learn.

Explore notes ↗
Putu Adi Guna Permana
ABOUT THE AUTHOR

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Writer and founder of Diary Coding — sharing notes, tutorials, and experiences about programming for anyone who wants to keep learning.