Ruang penulis
SEBUAH JURNAL TENTANG TEKNOLOGI

Belajar hal baru.
Tulis. Bagikan.

Ruang untuk merangkai pengetahuan, satu baris kode setiap hari.
Temukan tutorial, ide, dan catatan dari perjalanan belajar.

1914 catatan & terus bertumbuh
PILIHAN EDITOR
Java

Memahami Java Stream: olah koleksi dengan lebih ringkas

Pelajari alur filter, map, dan collect untuk mengolah data Java dengan kode yang mudah dibaca.

D Tim Diary Coding · 1 menit baca
UNTUK RASA INGIN TAHUMU

Catatan terbaru.

CORE API / CATATAN</>
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 menit baca
CORE API / CATATAN</>
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 menit baca
CORE API / CATATAN</>
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 menit baca
CORE API / CATATAN</>
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 menit baca
CORE API / CATATAN</>
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 menit baca
CORE API / CATATAN</>
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 menit baca

Pengetahuan tumbuh ketika dibagikan.

Simpan rasa ingin tahu. Selalu ada hal baru untuk dipelajari.

Jelajahi catatan ↗
Putu Adi Guna Permana
TENTANG PENULIS

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

Penulis dan pendiri Diary Coding — berbagi catatan, tutorial, dan pengalaman seputar pemrograman untuk siapa pun yang ingin terus belajar.