SupportWriter space ↗
REFERENCE LIBRARY

References from other publishers

Republished articles with source attribution. This collection is separate from Diary Coding’s original guides and does not display ads.

Read original guides → · Editorial policy

FOR YOUR CURIOSITY

Latest notes.

CORE API / NOTES</>↗
Core API06 Mar 2013

How to split a string by a number of characters?

The following code snippet will show you how to split a string by numbers of characters. We create a method called splitToNChars() that takes two arguments. The first arguments is the string to be split and the second arguments is the split size. This splitToNChars() method will split the string in a for loop. First […]

Wayan · 2 min read
SECURITY / NOTES</>↗
Security06 Mar 2013

How to create a digital signature and sign data?

In the following code snippet you will learn how to generate a digital signature to sign a data or file. To create a signature we will need a key pair of public and private key. But for the signing process we’ll only use the private key, while the public key will be used to verify […]

Wayan · 3 min read
SECURITY / NOTES</>↗
Security05 Mar 2013

How do I generate public and private keys?

The code snippet below show you how to use the JDK Security API to generate public and private keys. A private key can be used to sign a document and the public key is used to verify that the signature of the document is valid. The API we used to generate the key pairs is […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API05 Mar 2013

How do I remove redundant elements from a Path?

To eliminate redundant elements from a Path we can use the Path.normalize() method. For example in the following code snippet. When try accessing the README file in the current directory the . symbol in the Path elements considered to be redundant, we don’t need it. That’s why we normalize the Path. package org.kodejava.io; import java.nio.file.Path; […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API27 Feb 2013

How to get some information about Path object?

The java.nio.Path provides some methods to obtain information about the Path. For example, you can get information about the file name, the parent and the root path. For these you can call the getFileName(), getParent() and getRoot() method respectively. You can also get the number of elements that make up this Path using the getNameCount() […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API26 Feb 2013

How do I create a java.nio.Path?

The following code snippet show you how to create a Path. A Path (java.nio.Path) in an interface that represent a location in a file system, such as C:/Windows/System32 or /usr/bin. To create a Path we can use the java.nio.Paths.get(String first, String… more) methods. Below you can see how to create a Path by passing only […]

Wayan · 2 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.